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

Unified Diff: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 144143005: Preserve shape-box order in non-computed values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updating patch to trunk Created 6 years, 10 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: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index 78a0245da7aecc7f128add31de82281a9876f239..0c94b6463d6c5023f131472dcda7dbb2da3d1bf9 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -481,18 +481,31 @@ namespace WebCore {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
if (primitiveValue->getValueID() == CSSValueAuto)
{{ set_value(property) }}(nullptr);
- else if (primitiveValue->getValueID() == CSSValueMarginBox
- || primitiveValue->getValueID() == CSSValueBorderBox
- || primitiveValue->getValueID() == CSSValuePaddingBox
- || primitiveValue->getValueID() == CSSValueContentBox)
- {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(LayoutBox(*primitiveValue)));
else if (primitiveValue->getValueID() == CSSValueOutsideShape)
{{ set_value(property) }}(ShapeValue::createOutsideValue());
- else if (primitiveValue->isShape()) {
- {{ set_value(property) }}(ShapeValue::createShapeValue(basicShapeForValue(state, primitiveValue->getShapeValue())));
- }
} else if (value->isImageValue() || value->isImageSetValue()) {
{{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage({{property_id}}, value)));
+ } else if (value->isValueList()) {
+ RefPtr<BasicShape> shape;
+ LayoutBox layoutBox = BoxMissing;
+ CSSValueList* valueList = toCSSValueList(value);
+ for (unsigned i = 0; i < valueList->length(); ++i) {
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWithoutBoundsCheck(i));
+ if (primitiveValue->isShape())
+ shape = basicShapeForValue(state, primitiveValue->getShapeValue());
+ else if (primitiveValue->getValueID() == CSSValueContentBox
+ || primitiveValue->getValueID() == CSSValueBorderBox
+ || primitiveValue->getValueID() == CSSValuePaddingBox
+ || primitiveValue->getValueID() == CSSValueMarginBox)
+ layoutBox = LayoutBox(*primitiveValue);
+ else
+ return;
+ }
+
+ if (shape)
+ {{ set_value(property) }}(ShapeValue::createShapeValue(shape.release(), layoutBox));
+ else if (layoutBox != BoxMissing)
+ {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(layoutBox));
}
}
{%- endmacro %}
« no previous file with comments | « LayoutTests/fast/shapes/parsing/parsing-test-utils.js ('k') | Source/core/animation/AnimatableShapeValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698