Index: Source/core/css/resolver/StyleBuilderCustom.cpp |
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp |
index 05be141688d92b7f6a61c57bb4e4a6b6b1f806a9..5674a64e9a892d509b4472bf419b6c3fb2f882df 100644 |
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp |
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp |
@@ -1112,6 +1112,38 @@ static Color colorFromSVGColorCSSValue(SVGColor* svgColor, const StyleColor& fgC |
return color; |
} |
+static EPaintOrder paintOrderFlattened(CSSValue* cssPaintOrder) |
+{ |
+ if (cssPaintOrder->isValueList()) { |
+ int paintOrder = 0; |
+ CSSValueListInspector iter(cssPaintOrder); |
+ for (size_t i = 0; i < iter.length(); i++) { |
+ CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(iter.item(i)); |
+ |
+ EPaintOrderType paintOrderType = PT_NONE; |
+ switch (value->getValueID()) { |
+ case CSSValueFill: |
+ paintOrderType = PT_FILL; |
+ break; |
+ case CSSValueStroke: |
+ paintOrderType = PT_STROKE; |
+ break; |
+ case CSSValueMarkers: |
+ paintOrderType = PT_MARKERS; |
+ break; |
+ default: |
+ ASSERT_NOT_REACHED(); |
+ break; |
+ } |
+ |
+ paintOrder |= (paintOrderType << kPaintOrderBitwidth*i); |
+ } |
+ return (EPaintOrder)paintOrder; |
+ } |
+ |
+ return PO_NORMAL; |
+} |
+ |
static bool numberToFloat(const CSSPrimitiveValue* primitiveValue, float& out) |
{ |
if (!primitiveValue) |
@@ -2335,6 +2367,12 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state, |
state.style()->accessSVGStyle()->setGlyphOrientationHorizontal(orientation); |
break; |
} |
+ case CSSPropertyPaintOrder: { |
+ HANDLE_SVG_INHERIT_AND_INITIAL(paintOrder, PaintOrder) |
+ if (value->isValueList()) |
+ state.style()->accessSVGStyle()->setPaintOrder(paintOrderFlattened(value)); |
+ break; |
+ } |
case CSSPropertyGlyphOrientationVertical: |
{ |
HANDLE_SVG_INHERIT_AND_INITIAL(glyphOrientationVertical, GlyphOrientationVertical) |