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

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: Applied suggested changes. 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
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('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/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..818e9a9c7d5fbc0b5bdd4c3afa7ca227f4cf81ac 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()) // TODO (lajava): We must avoid this Reattach.
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, ItemPosition resolvedAutoPositionForLayoutObject) const
+{
+ // The auto keyword computes to the parent's align-items computed value, or to "stretch", if not set or "auto".
+ if (alignSelfPosition() == ItemPositionAuto) {
+ if (parentStyle.alignItemsPosition() == ItemPositionAuto)
+ return {resolvedAutoPositionForLayoutObject, OverflowAlignmentDefault};
+ return parentStyle.alignItems();
+ }
+ return alignSelf();
+}
+
ItemPosition ComputedStyle::resolveJustification(const ComputedStyle& parentStyle, const ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject)
{
if (childStyle.justifySelfPosition() == ItemPositionAuto)
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698