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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2746453005: [css-align] Adapt self-alignment properties to the new baseline syntax (Closed)
Patch Set: More layout tests fixes. Created 3 years, 9 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/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 6c90124dc2247afd33c1b8994c3fdb5f85e33d2c..2df7da51b875cff8af88d62947afdb6afe989792 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -497,13 +497,25 @@ static CSSValueList* valueForItemPositionWithOverflowAlignment(
CSSValueList* result = CSSValueList::createSpaceSeparated();
if (data.positionType() == LegacyPosition)
result->append(*CSSIdentifierValue::create(CSSValueLegacy));
- // 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.
- result->append(*CSSIdentifierValue::create(
- data.position() == ItemPositionAuto
- ? ComputedStyle::initialDefaultAlignment().position()
- : data.position()));
+ if (data.position() == ItemPositionAuto) {
+ // 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.
+ result->append(*CSSIdentifierValue::create(
+ ComputedStyle::initialDefaultAlignment().position()));
+ } else if (data.position() == ItemPositionBaseline) {
+ result->append(
+ *CSSValuePair::create(CSSIdentifierValue::create(CSSValueBaseline),
+ CSSIdentifierValue::create(CSSValueBaseline),
+ CSSValuePair::DropIdenticalValues));
+ } else if (data.position() == ItemPositionLastBaseline) {
+ result->append(
+ *CSSValuePair::create(CSSIdentifierValue::create(CSSValueLast),
+ CSSIdentifierValue::create(CSSValueBaseline),
+ CSSValuePair::DropIdenticalValues));
+ } else {
+ result->append(*CSSIdentifierValue::create(data.position()));
+ }
if (data.position() >= ItemPositionCenter &&
data.overflow() != OverflowAlignmentDefault)
result->append(*CSSIdentifierValue::create(data.overflow()));

Powered by Google App Engine
This is Rietveld 408576698