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

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

Issue 2750843002: [css-align] Adapt content-alignment properties to the new baseline syntax (Closed)
Patch Set: Don't use raw pointers attributes on a GC managed class. 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 6227c6d6293da1a0824d170335fb272c5a04f007..c7dd2a55325c0941cfaf7518b23559415f4008a5 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -659,16 +659,32 @@ valueForContentPositionAndDistributionWithOverflowAlignment(
const StyleContentAlignmentData& data,
CSSValueID normalBehaviorValueID) {
CSSValueList* result = CSSValueList::createSpaceSeparated();
+ // Handle content-distribution values
if (data.distribution() != ContentDistributionDefault)
result->append(*CSSIdentifierValue::create(data.distribution()));
- if (data.distribution() == ContentDistributionDefault ||
- data.position() != ContentPositionNormal) {
- if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() &&
- data.position() == ContentPositionNormal)
- result->append(*CSSIdentifierValue::create(normalBehaviorValueID));
- else
+
+ // Handle content-position values (either as fallback or actual value)
+ switch (data.position()) {
+ case ContentPositionNormal:
+ // Handle 'normal' value, not valid as content-distribution fallback.
+ if (data.distribution() == ContentDistributionDefault) {
+ result->append(*CSSIdentifierValue::create(
+ RuntimeEnabledFeatures::cssGridLayoutEnabled()
+ ? CSSValueNormal
+ : normalBehaviorValueID));
+ }
+ break;
+ case ContentPositionLastBaseline:
+ result->append(
+ *CSSValuePair::create(CSSIdentifierValue::create(CSSValueLast),
+ CSSIdentifierValue::create(CSSValueBaseline),
+ CSSValuePair::DropIdenticalValues));
+ break;
+ default:
result->append(*CSSIdentifierValue::create(data.position()));
}
+
+ // Handle overflow-alignment (only allowed for content-position values)
if ((data.position() >= ContentPositionCenter ||
data.distribution() != ContentDistributionDefault) &&
data.overflow() != OverflowAlignmentDefault)

Powered by Google App Engine
This is Rietveld 408576698