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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 1625993004: [css-align] Avoid the style Reattach whenever align-items changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the parsing tests and skipping the rest. Created 4 years, 11 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/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 874e929fbcf1e18d199b48bc3f6870a7f744c8fb..1524385a8fc628f29d2cb85dcf01c84620d86f90 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -182,8 +182,7 @@ StyleRecalcChange ComputedStyle::stylePropagationDiff(const ComputedStyle* oldSt
|| oldStyle->hasPseudoStyle(FIRST_LETTER) != newStyle->hasPseudoStyle(FIRST_LETTER)
|| !oldStyle->contentDataEquivalent(newStyle)
|| oldStyle->hasTextCombine() != newStyle->hasTextCombine()
- || oldStyle->justifyItems() != newStyle->justifyItems()
- || oldStyle->alignItems() != newStyle->alignItems())
+ || oldStyle->justifyItems() != newStyle->justifyItems())
esprehn 2016/01/29 04:20:56 we need to fix justifyItems too btw (in another pa
return Reattach;
if (oldStyle->inheritedNotEqual(*newStyle))
@@ -206,6 +205,17 @@ ItemPosition ComputedStyle::resolveAlignment(const ComputedStyle& parentStyle, c
return childStyle.alignSelfPosition();
}
+const StyleSelfAlignmentData ComputedStyle::resolvedAlignment(const ComputedStyle& parentStyle, const ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject)
esprehn 2016/01/29 04:20:56 This should be an instance method on either the ch
+{
+ // The auto keyword computes to the parent's align-items computed value, or to "stretch", if not set or "auto".
+ if (childStyle.alignSelfPosition() == ItemPositionAuto) {
+ if (parentStyle.alignItemsPosition() == ItemPositionAuto)
+ return {resolvedAutoPositionForLayoutObject, OverflowAlignmentDefault};
+ return parentStyle.alignItems();
+ }
+ return childStyle.alignSelf();
+}
+
ItemPosition ComputedStyle::resolveJustification(const ComputedStyle& parentStyle, const ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject)
{
if (childStyle.justifySelfPosition() == ItemPositionAuto)

Powered by Google App Engine
This is Rietveld 408576698