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

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

Issue 1150313002: *** NOT FOR LANDING *** Unprefix multicol behind a flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/css/ComputedStyleCSSValueMapping.h ('k') | Source/core/css/PropertySetCSSStyleDeclaration.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/Source/core/css/ComputedStyleCSSValueMapping.cpp b/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 8575bb40ebedcc50a133746ad28065abdeed6253..722bf30ef5c2e0f119b3113148fb3305fdd28452 100644
--- a/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -405,7 +405,7 @@ static PassRefPtrWillBeRawPtr<CSSValueList> valuesForGridShorthand(const StylePr
{
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
for (size_t i = 0; i < shorthand.length(); ++i) {
- RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, ComputedStyleCSSValueMapping::DoingShorthand, allowVisitedStyle);
ASSERT(value);
list->append(value.release());
}
@@ -416,7 +416,7 @@ static PassRefPtrWillBeRawPtr<CSSValueList> valuesForShorthandProperty(const Sty
{
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
for (size_t i = 0; i < shorthand.length(); ++i) {
- RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(shorthand.properties()[i], style, layoutObject, styledNode, ComputedStyleCSSValueMapping::DoingShorthand, allowVisitedStyle);
ASSERT(value);
list->append(value);
}
@@ -431,7 +431,7 @@ static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const C
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
RefPtrWillBeRawPtr<CSSValueList> beforeSlash = CSSValueList::createSpaceSeparated();
if (!currLayer->next()) { // color only for final layer
- RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(CSSPropertyBackgroundColor, style, layoutObject, styledNode, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> value = ComputedStyleCSSValueMapping::get(CSSPropertyBackgroundColor, style, layoutObject, styledNode, ComputedStyleCSSValueMapping::DoingShorthand, allowVisitedStyle);
ASSERT(value);
beforeSlash->append(value);
}
@@ -1083,10 +1083,10 @@ static PassRefPtrWillBeRawPtr<CSSValueList> valuesForSidesShorthand(const StyleP
{
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
// Assume the properties are in the usual order top, right, bottom, left.
- RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[0], style, layoutObject, styledNode, allowVisitedStyle);
- RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[1], style, layoutObject, styledNode, allowVisitedStyle);
- RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[2], style, layoutObject, styledNode, allowVisitedStyle);
- RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[3], style, layoutObject, styledNode, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> topValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[0], style, layoutObject, styledNode, ComputedStyleCSSValueMapping::DoingShorthand, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> rightValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[1], style, layoutObject, styledNode, ComputedStyleCSSValueMapping::DoingShorthand, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> bottomValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[2], style, layoutObject, styledNode, ComputedStyleCSSValueMapping::DoingShorthand, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> leftValue = ComputedStyleCSSValueMapping::get(shorthand.properties()[3], style, layoutObject, styledNode, ComputedStyleCSSValueMapping::DoingShorthand, allowVisitedStyle);
// All 4 properties must be specified.
if (!topValue || !rightValue || !bottomValue || !leftValue)
@@ -1318,9 +1318,10 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::valueForFilter(co
return list.release();
}
-PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, bool allowVisitedStyle)
+PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID unresolvedProperty, const ComputedStyle& style, const LayoutObject* layoutObject, Node* styledNode, ShorthandState shorthandState, bool allowVisitedStyle)
{
const SVGComputedStyle& svgStyle = style.svgStyle();
+ CSSPropertyID propertyID = resolveCSSPropertyID(unresolvedProperty);
propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style.direction(), style.writingMode());
switch (propertyID) {
case CSSPropertyInvalid:
@@ -1491,24 +1492,36 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
return cssValuePool().createColorValue(allowVisitedStyle ? style.visitedDependentColor(CSSPropertyColor).rgb() : style.color().rgb());
case CSSPropertyWebkitPrintColorAdjust:
return cssValuePool().createValue(style.printColorAdjust());
- case CSSPropertyWebkitColumnCount:
+ case CSSPropertyColumnCount:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnCount && shorthandState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
if (style.hasAutoColumnCount())
return cssValuePool().createIdentifierValue(CSSValueAuto);
return cssValuePool().createValue(style.columnCount(), CSSPrimitiveValue::CSS_NUMBER);
case CSSPropertyColumnFill:
- ASSERT(RuntimeEnabledFeatures::regionBasedColumnsEnabled());
+ ASSERT(RuntimeEnabledFeatures::unprefixMulticolEnabled());
return cssValuePool().createValue(style.columnFill());
- case CSSPropertyWebkitColumnGap:
+ case CSSPropertyColumnGap:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnGap && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
if (style.hasNormalColumnGap())
return cssValuePool().createIdentifierValue(CSSValueNormal);
return zoomAdjustedPixelValue(style.columnGap(), style);
- case CSSPropertyWebkitColumnRuleColor:
+ case CSSPropertyColumnRuleColor:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnRuleColor && shorthandState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
return allowVisitedStyle ? cssValuePool().createColorValue(style.visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style, style.columnRuleColor());
- case CSSPropertyWebkitColumnRuleStyle:
+ case CSSPropertyColumnRuleStyle:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnRuleStyle && shorthandState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
return cssValuePool().createValue(style.columnRuleStyle());
- case CSSPropertyWebkitColumnRuleWidth:
+ case CSSPropertyColumnRuleWidth:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnRuleWidth && shorthandState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
return zoomAdjustedPixelValue(style.columnRuleWidth(), style);
- case CSSPropertyWebkitColumnSpan:
+ case CSSPropertyColumnSpan:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnSpan && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
return cssValuePool().createIdentifierValue(style.columnSpan() ? CSSValueAll : CSSValueNone);
case CSSPropertyWebkitColumnBreakAfter:
return cssValuePool().createValue(style.columnBreakAfter());
@@ -1516,7 +1529,9 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
return cssValuePool().createValue(style.columnBreakBefore());
case CSSPropertyWebkitColumnBreakInside:
return cssValuePool().createValue(style.columnBreakInside());
- case CSSPropertyWebkitColumnWidth:
+ case CSSPropertyColumnWidth:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnWidth && shorthandState != DoingShorthand && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
if (style.hasAutoColumnWidth())
return cssValuePool().createIdentifierValue(CSSValueAuto);
return zoomAdjustedPixelValue(style.columnWidth(), style);
@@ -2312,14 +2327,14 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
case CSSPropertyBackground:
return valuesForBackgroundShorthand(style, layoutObject, styledNode, allowVisitedStyle);
case CSSPropertyBorder: {
- RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, layoutObject, styledNode, allowVisitedStyle);
+ RefPtrWillBeRawPtr<CSSValue> value = get(CSSPropertyBorderTop, style, layoutObject, styledNode, DoingShorthand, allowVisitedStyle);
const CSSPropertyID properties[] = {
CSSPropertyBorderRight,
CSSPropertyBorderBottom,
CSSPropertyBorderLeft
};
for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) {
- if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, layoutObject, styledNode, allowVisitedStyle)))
+ if (!compareCSSValuePtr<CSSValue>(value, get(properties[i], style, layoutObject, styledNode, DoingShorthand, allowVisitedStyle)))
return nullptr;
}
return value.release();
@@ -2342,10 +2357,14 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
return valuesForShorthandProperty(borderTopShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
case CSSPropertyBorderWidth:
return valuesForSidesShorthand(borderWidthShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
- case CSSPropertyWebkitColumnRule:
- return valuesForShorthandProperty(webkitColumnRuleShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
- case CSSPropertyWebkitColumns:
- return valuesForShorthandProperty(webkitColumnsShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
+ case CSSPropertyColumnRule:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumnRule && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
+ return valuesForShorthandProperty(columnRuleShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
+ case CSSPropertyColumns:
+ if (unresolvedProperty != CSSPropertyAliasWebkitColumns && !RuntimeEnabledFeatures::unprefixMulticolEnabled())
+ return nullptr;
+ return valuesForShorthandProperty(columnsShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
case CSSPropertyListStyle:
return valuesForShorthandProperty(listStyleShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
case CSSPropertyMargin:
« no previous file with comments | « Source/core/css/ComputedStyleCSSValueMapping.h ('k') | Source/core/css/PropertySetCSSStyleDeclaration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698