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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2727853002: [css-display] Support display: contents pseudo-elements.
Patch Set: [css-display] Support display: contents pseudo-elements. Created 3 years, 10 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/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 6e66dcecbf1827f0aa76ed281430a9a10e05164a..c5a185e1fde853ee40e84ddfb8704a3eebe5bf01 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -174,8 +174,11 @@ LayoutObject* LayoutObject::createObject(Element* element,
switch (style.display()) {
case EDisplay::None:
- case EDisplay::Contents:
return nullptr;
+ case EDisplay::Contents:
+ if (LIKELY(!element->isPseudoElement()))
+ return nullptr;
+ // fall through
case EDisplay::Inline:
return new LayoutInline(element);
case EDisplay::Block:
@@ -3019,6 +3022,9 @@ ComputedStyle* LayoutObject::cachedFirstLineStyle() const {
ComputedStyle* LayoutObject::getCachedPseudoStyle(
PseudoId pseudo,
const ComputedStyle* parentStyle) const {
+ DCHECK_NE(pseudo, PseudoIdBefore);
+ DCHECK_NE(pseudo, PseudoIdAfter);
+
if (pseudo < FirstInternalPseudoId && !style()->hasPseudoStyle(pseudo))
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698