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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp

Issue 2450093005: Support display: contents for elements, first-line and first-letter pseudos. (Closed)
Patch Set: Allow text as child of the LayoutView, since it can happen with display: contents Created 4 years 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/css/resolver/StyleAdjuster.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
index 615341c661e673ae84561e230ac29c0836194158..e573d88f10ae4458038e14ad50a3cdeed75cfdc5 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -129,9 +129,9 @@ static bool isInTopLayer(const Element* element, const ComputedStyle& style) {
style.styleType() == PseudoIdBackdrop;
}
-static bool parentStyleForcesZIndexToCreateStackingContext(
- const ComputedStyle& parentStyle) {
- return parentStyle.isDisplayFlexibleOrGridBox();
+static bool layoutParentStyleForcesZIndexToCreateStackingContext(
+ const ComputedStyle& layoutParentStyle) {
+ return layoutParentStyle.isDisplayFlexibleOrGridBox();
}
void StyleAdjuster::adjustStyleForEditing(ComputedStyle& style) {
@@ -316,7 +316,7 @@ static void adjustOverflow(ComputedStyle& style) {
}
static void adjustStyleForDisplay(ComputedStyle& style,
- const ComputedStyle& parentStyle,
+ const ComputedStyle& layoutParentStyle,
Document* document) {
if (style.display() == EDisplay::Block && !style.isFloating())
return;
@@ -325,7 +325,7 @@ static void adjustStyleForDisplay(ComputedStyle& style,
// first-line, since it's not completely clear how that should work.
if (style.display() == EDisplay::Inline &&
style.styleType() == PseudoIdNone &&
- style.getWritingMode() != parentStyle.getWritingMode())
+ style.getWritingMode() != layoutParentStyle.getWritingMode())
style.setDisplay(EDisplay::InlineBlock);
// After performing the display mutation, check table rows. We do not honor
@@ -358,7 +358,7 @@ static void adjustStyleForDisplay(ComputedStyle& style,
style.display() == EDisplay::TableRow ||
style.display() == EDisplay::TableRowGroup ||
style.display() == EDisplay::TableCell)
- style.setWritingMode(parentStyle.getWritingMode());
+ style.setWritingMode(layoutParentStyle.getWritingMode());
// FIXME: Since we don't support block-flow on flexible boxes yet, disallow
// setting of block-flow to anything other than TopToBottomWritingMode.
@@ -368,7 +368,7 @@ static void adjustStyleForDisplay(ComputedStyle& style,
style.display() == EDisplay::WebkitInlineBox))
style.setWritingMode(TopToBottomWritingMode);
- if (parentStyle.isDisplayFlexibleOrGridBox()) {
+ if (layoutParentStyle.isDisplayFlexibleOrGridBox()) {
style.setFloating(EFloat::None);
style.setDisplay(equivalentBlockDisplay(style.display()));
@@ -386,6 +386,7 @@ static void adjustStyleForDisplay(ComputedStyle& style,
void StyleAdjuster::adjustComputedStyle(ComputedStyle& style,
const ComputedStyle& parentStyle,
+ const ComputedStyle& layoutParentStyle,
Element* element) {
if (style.display() != EDisplay::None &&
style.display() != EDisplay::Contents) {
@@ -408,7 +409,7 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style,
// display setting in adjustStyeForTagName() above.
adjustStyleForFirstLetter(style);
- adjustStyleForDisplay(style, parentStyle,
+ adjustStyleForDisplay(style, layoutParentStyle,
element ? &element->document() : 0);
// Paint containment forces a block formatting context, so we must coerce
@@ -424,7 +425,8 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style,
// Make sure our z-index value is only applied if the object is positioned.
if (style.position() == StaticPosition &&
- !parentStyleForcesZIndexToCreateStackingContext(parentStyle)) {
+ !layoutParentStyleForcesZIndexToCreateStackingContext(
+ layoutParentStyle)) {
style.setIsStackingContext(false);
// TODO(alancutter): Avoid altering z-index here.
if (!style.hasAutoZIndex())

Powered by Google App Engine
This is Rietveld 408576698