Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2450093005: Support display: contents for elements, first-line and first-letter pseudos. (Closed)
Patch Set: Support display: contents for elements, first-line and first-letter pseudos. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 24b75742fc9986422bbe76bbeb7380fefc21829f..e4589602368c0ff0cd546ec20d1ce10059b2fa1d 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1527,7 +1527,8 @@ const AtomicString Element::imageSourceURL() const {
}
bool Element::layoutObjectIsNeeded(const ComputedStyle& style) {
- return style.display() != EDisplay::None;
+ return style.display() != EDisplay::None &&
+ style.display() != EDisplay::Contents;
}
LayoutObject* Element::createLayoutObject(const ComputedStyle& style) {
@@ -3133,6 +3134,22 @@ const ComputedStyle* Element::ensureComputedStyle(
return elementStyle->addCachedPseudoStyle(result.release());
}
+ComputedStyle* Element::displayContentsStyle() const {
+ if (layoutObject() || !hasRareData())
+ return 0;
jfernandez 2016/10/27 17:08:01 return nullptr
+
+ ComputedStyle* style = elementRareData()->computedStyle();
+ if (!style || style->display() != EDisplay::Contents)
+ return 0;
jfernandez 2016/10/27 17:08:01 return nullptr
+
+ return style;
+}
+
+void Element::storeDisplayContentsStyle(ComputedStyle& style) {
+ DCHECK_EQ(style.display(), EDisplay::Contents);
+ ensureElementRareData().setComputedStyle(&style);
jfernandez 2016/10/27 17:08:01 The setComputedStyle argument is a PassRefPtr so I
+}
+
AtomicString Element::computeInheritedLanguage() const {
const Node* n = this;
AtomicString value;

Powered by Google App Engine
This is Rietveld 408576698