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

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: Fix review issues and add paint-order for text too Created 7 years, 5 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..b4cc0a327089978ffadbfd17695c2716f11279b0 100644
--- a/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
@@ -59,6 +59,27 @@ 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) {
+ case PT_FILL:
+ case PT_STROKE:
+ case PT_MARKERS:
+ list->append(CSSPrimitiveValue::create(paintOrderType));
+ break;
+ case PT_NONE:
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ } while (paintorder >>= kPaintOrderBitwidth);
+
+ return list.release();
+}
+
PassRefPtr<SVGPaint> CSSComputedStyleDeclaration::adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint> newPaint, RenderStyle* style) const
{
RefPtr<SVGPaint> paint = newPaint;
@@ -191,6 +212,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