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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2753013004: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text
Patch Set: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text Created 3 years, 9 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: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 4227d239d689f8adb6c03b243fbfda8b7adaad54..4acd62b3dc9e86a10423a1dfa328075cb8c39b87 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -98,9 +98,8 @@ static CSSValue* zoomAdjustedPixelValueForLength(const Length& length,
return CSSValue::create(length, style.effectiveZoom());
}
-static CSSValue* pixelValueForUnzoomedLength(
- const UnzoomedLength& unzoomedLength,
- const ComputedStyle& style) {
+static CSSValue* pixelValueForUnzoomedLength(const ComputedStyle& style) {
+ const UnzoomedLength unzoomedLength = style.strokeWidth();
const Length& length = unzoomedLength.length();
if (length.isFixed())
return CSSPrimitiveValue::create(length.value(),
@@ -1665,10 +1664,10 @@ static CSSValue* strokeDashArrayToCSSValueList(const SVGDashArray& dashes,
return list;
}
-static CSSValue* paintOrderToCSSValueList(const SVGComputedStyle& svgStyle) {
+static CSSValue* paintOrderToCSSValueList(const ComputedStyle& style) {
CSSValueList* list = CSSValueList::createSpaceSeparated();
for (int i = 0; i < 3; i++) {
- EPaintOrderType paintOrderType = svgStyle.paintOrderType(i);
+ EPaintOrderType paintOrderType = style.paintOrderType(i);
switch (paintOrderType) {
case PT_FILL:
case PT_STROKE:
@@ -3364,6 +3363,15 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
return list;
}
+ case CSSPropertyStrokeLinecap:
+ return CSSIdentifierValue::create(style.capStyle());
+ case CSSPropertyStrokeLinejoin:
+ return CSSIdentifierValue::create(style.joinStyle());
+ case CSSPropertyPaintOrder:
+ return paintOrderToCSSValueList(style);
+ case CSSPropertyStrokeWidth:
+ return pixelValueForUnzoomedLength(style);
+
// Unimplemented CSS 3 properties (including CSS3 shorthand properties).
case CSSPropertyWebkitTextEmphasis:
return nullptr;
@@ -3461,10 +3469,6 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
return CSSIdentifierValue::create(svgStyle.colorRendering());
case CSSPropertyShapeRendering:
return CSSIdentifierValue::create(svgStyle.shapeRendering());
- case CSSPropertyStrokeLinecap:
- return CSSIdentifierValue::create(svgStyle.capStyle());
- case CSSPropertyStrokeLinejoin:
- return CSSIdentifierValue::create(svgStyle.joinStyle());
case CSSPropertyStrokeMiterlimit:
return CSSPrimitiveValue::create(svgStyle.strokeMiterLimit(),
CSSPrimitiveValue::UnitType::Number);
@@ -3516,8 +3520,6 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
case CSSPropertyStrokeDashoffset:
return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(),
style);
- case CSSPropertyStrokeWidth:
- return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style);
case CSSPropertyBaselineShift: {
switch (svgStyle.baselineShift()) {
case BS_SUPER:
@@ -3533,8 +3535,6 @@ const CSSValue* ComputedStyleCSSValueMapping::get(
}
case CSSPropertyBufferedRendering:
return CSSIdentifierValue::create(svgStyle.bufferedRendering());
- case CSSPropertyPaintOrder:
- return paintOrderToCSSValueList(svgStyle);
case CSSPropertyVectorEffect:
return CSSIdentifierValue::create(svgStyle.vectorEffect());
case CSSPropertyMaskType:
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.json5 ('k') | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698