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

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

Issue 2712673002: [css-align] Use the layout parent style to determine the value of alignment-related properties. (Closed)
Patch Set: [css-align] Use the layout parent style to determine the value of alignment-related properties. 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
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dc21e25edac0fcf4d09c08933395faf70e5057f6..a757ed1c9a93f0bf594f48ce80f28fb1ddfdee00 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -159,8 +159,9 @@ static void adjustStyleForFirstLetter(ComputedStyle& style) {
style.setPosition(EPosition::kStatic);
}
-void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style,
- const ComputedStyle& parentStyle) {
+void StyleAdjuster::adjustStyleForAlignment(
+ ComputedStyle& style,
+ const ComputedStyle& layoutParentStyle) {
// To avoid needing to copy the RareNonInheritedData, we repurpose the 'auto'
// flag to not just mean 'auto' prior to running the StyleAdjuster but also
// mean 'normal' after running it.
@@ -169,25 +170,25 @@ void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style,
// 'auto' computes to the the inherited value. Otherwise, 'auto' computes to
// 'normal'.
if (style.justifyItemsPosition() == ItemPositionAuto) {
- if (parentStyle.justifyItemsPositionType() == LegacyPosition)
- style.setJustifyItems(parentStyle.justifyItems());
+ if (layoutParentStyle.justifyItemsPositionType() == LegacyPosition)
+ style.setJustifyItems(layoutParentStyle.justifyItems());
}
// The 'auto' keyword computes the computed value of justify-items on the
// parent (minus any legacy keywords), or 'normal' if the box has no parent.
if (style.justifySelfPosition() == ItemPositionAuto) {
- if (parentStyle.justifyItemsPositionType() == LegacyPosition)
- style.setJustifySelfPosition(parentStyle.justifyItemsPosition());
- else if (parentStyle.justifyItemsPosition() != ItemPositionAuto)
- style.setJustifySelf(parentStyle.justifyItems());
+ if (layoutParentStyle.justifyItemsPositionType() == LegacyPosition)
+ style.setJustifySelfPosition(layoutParentStyle.justifyItemsPosition());
+ else if (layoutParentStyle.justifyItemsPosition() != ItemPositionAuto)
+ style.setJustifySelf(layoutParentStyle.justifyItems());
}
// The 'auto' keyword computes the computed value of align-items on the parent
// or 'normal' if the box has no parent.
if (style.alignSelfPosition() == ItemPositionAuto &&
- parentStyle.alignItemsPosition() !=
+ layoutParentStyle.alignItemsPosition() !=
ComputedStyle::initialDefaultAlignment().position())
- style.setAlignSelf(parentStyle.alignItems());
+ style.setAlignSelf(layoutParentStyle.alignItems());
}
static void adjustStyleForHTMLElement(ComputedStyle& style,
@@ -506,7 +507,7 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style,
if (isSVGTextElement(*element))
style.clearMultiCol();
}
- adjustStyleForAlignment(style, parentStyle);
+ adjustStyleForAlignment(style, layoutParentStyle);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698