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

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

Issue 14907011: Support 'paint-order' from SVG2. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: codereview fixes Created 7 years, 6 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/core/css/SVGCSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/SVGCSSComputedStyleDeclaration.cpp b/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
index fd03b7c4e35fdf7821bfe42f56b4b5ce757a98dc..11e508b1f605a76eac77d9fab3a54f87dfe8c698 100644
--- a/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
@@ -59,6 +59,28 @@ static PassRefPtr<CSSValue> strokeDashArrayToCSSValueList(const Vector<SVGLength
return list.release();
}
+static PassRefPtr<CSSValue> paintOrderToCSSValueList(EPaintOrder paintorder)
+{
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ do {
+ EPaintOrderType paintOrderType = (EPaintOrderType)(paintorder & (1 << kPaintOrderBitwidth - 1));
+ switch (paintOrderType) {
pdr. 2013/06/25 15:30:45 Nit: indent inside the switch statement.
+ case PT_FILL:
+ case PT_STROKE:
+ case PT_MARKERS:
+ list->append(CSSPrimitiveValue::create(paintOrderType));
+ break;
+ case PT_NONE:
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
pdr. 2013/06/25 15:30:45 Nit: Our style is to leave the while loop on the s
+ while (paintorder <<= kPaintOrderBitwidth);
+
+ return list.release();
+}
+
PassRefPtr<SVGPaint> CSSComputedStyleDeclaration::adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint> newPaint, RenderStyle* style) const
{
RefPtr<SVGPaint> paint = newPaint;
@@ -191,6 +213,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(CSSProp
}
case CSSPropertyWebkitSvgShadow:
return valueForShadow(svgStyle->shadow(), propertyID, style);
+ case CSSPropertyPaintOrder:
+ return paintOrderToCSSValueList(svgStyle->paintOrder());
case CSSPropertyVectorEffect:
return CSSPrimitiveValue::create(svgStyle->vectorEffect());
case CSSPropertyMaskType:

Powered by Google App Engine
This is Rietveld 408576698