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

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

Issue 2455093002: [css-align] Don't resolve 'auto' values for computed style. (Closed)
Patch Set: 'auto' is not valid for justify-items. Created 3 years, 7 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/LayoutFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index 512f64f3b365b1c734ef26493590e1283311f8a2..325b68b8331465adceb269823504780329574706 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -325,14 +325,13 @@ void LayoutFlexibleBox::RemoveChild(LayoutObject* child) {
intrinsic_size_along_main_axis_.erase(child);
}
-// TODO (lajava): Is this function still needed ? Every time the flex
-// container's align-items value changes we propagate the diff to its children
-// (see ComputedStyle::stylePropagationDiff).
void LayoutFlexibleBox::StyleDidChange(StyleDifference diff,
const ComputedStyle* old_style) {
LayoutBlock::StyleDidChange(diff, old_style);
- if (old_style && old_style->AlignItemsPosition() == kItemPositionStretch &&
+ if (old_style &&
+ old_style->ResolvedAlignItems(SelfAlignmentNormalBehavior())
+ .GetPosition() == kItemPositionStretch &&
diff.NeedsFullLayout()) {
// Flex items that were previously stretching need to be relayed out so we
// can compute new available cross axis space. This is only necessary for
@@ -1698,8 +1697,7 @@ ItemPosition LayoutFlexibleBox::AlignmentForChild(
const LayoutBox& child) const {
ItemPosition align =
child.StyleRef()
- .ResolvedAlignSelf(SelfAlignmentNormalBehavior(),
- child.IsAnonymous() ? Style() : nullptr)
+ .ResolvedAlignSelf(SelfAlignmentNormalBehavior(), Style())
.GetPosition();
DCHECK_NE(align, kItemPositionAuto);
DCHECK_NE(align, kItemPositionNormal);

Powered by Google App Engine
This is Rietveld 408576698