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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.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/SVGCSSValueKeywords.in ('k') | Source/core/page/RuntimeCSSEnabled.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/core/css/SVGCSSValueKeywords.in ('k') | Source/core/page/RuntimeCSSEnabled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698