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

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

Issue 22482004: Add support for the object-fit CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase for landing Created 7 years, 4 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/CSSValueKeywords.in ('k') | Source/core/css/SVGCSSParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SVGCSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/SVGCSSComputedStyleDeclaration.cpp b/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
index 4b774c2f92edff03693c204933a3b795cc29a9c4..b773e4f70896b61a82792a410647791db92084f0 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;
@@ -192,6 +213,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(CSSProp
return 0;
}
+ case CSSPropertyPaintOrder:
+ return paintOrderToCSSValueList(svgStyle->paintOrder());
case CSSPropertyVectorEffect:
return CSSPrimitiveValue::create(svgStyle->vectorEffect());
case CSSPropertyMaskType:
« no previous file with comments | « Source/core/css/CSSValueKeywords.in ('k') | Source/core/css/SVGCSSParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698