Implement stroke-miterlimit.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Apr 2017 13:17:11 +0000 (13:17 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Apr 2017 13:17:11 +0000 (13:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169078

Reviewed by Dean Jackson.

Source/WebCore:

Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.

Tests: fast/css/stroke-miterlimit-default.html
       fast/css/stroke-miterlimit-large.html
       fast/css/stroke-miterlimit-zero.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::updateGraphicsContext):
* rendering/TextPaintStyle.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::strokeMiterLimit):
(WebCore::RenderStyle::setStrokeMiterLimit):
(WebCore::RenderStyle::initialStrokeMiterLimit):
(WebCore::RenderStyle::setStrokeDashOffset):
* rendering/style/RenderStyleConstants.cpp:
* rendering/style/RenderStyleConstants.h:
* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialStrokeDashArray):
(WebCore::SVGRenderStyle::strokeDashArray):
(WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
(WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
(WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
* rendering/style/SVGRenderStyleDefs.cpp:
(WebCore::StyleStrokeData::StyleStrokeData):
(WebCore::StyleStrokeData::operator==):
* rendering/style/SVGRenderStyleDefs.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::hasSmoothStroke):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::applyStrokeStyleToContext):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):

LayoutTests:

* fast/css/stroke-miterlimit-default-expected.html: Added.
* fast/css/stroke-miterlimit-default.html: Added.
* fast/css/stroke-miterlimit-large-expected-mismatch.html: Added.
* fast/css/stroke-miterlimit-large.html: Added.
* fast/css/stroke-miterlimit-zero-expected-mismatch.html: Added.
* fast/css/stroke-miterlimit-zero.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214787 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/stroke-miterlimit-default-expected.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-miterlimit-default.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-miterlimit-large-expected-mismatch.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-miterlimit-large.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-miterlimit-zero-expected-mismatch.html [new file with mode: 0644]
LayoutTests/fast/css/stroke-miterlimit-zero.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSProperties.json
Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
Source/WebCore/rendering/TextPaintStyle.cpp
Source/WebCore/rendering/TextPaintStyle.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/SVGRenderStyle.cpp
Source/WebCore/rendering/style/SVGRenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp
Source/WebCore/rendering/style/SVGRenderStyleDefs.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/SVGRenderSupport.cpp
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp

index 9c62591..87b7013 100644 (file)
@@ -1,3 +1,17 @@
+2017-04-03  Per Arne Vollan  <pvollan@apple.com>
+
+        Implement stroke-miterlimit.
+        https://bugs.webkit.org/show_bug.cgi?id=169078
+
+        Reviewed by Dean Jackson.
+
+        * fast/css/stroke-miterlimit-default-expected.html: Added.
+        * fast/css/stroke-miterlimit-default.html: Added.
+        * fast/css/stroke-miterlimit-large-expected-mismatch.html: Added.
+        * fast/css/stroke-miterlimit-large.html: Added.
+        * fast/css/stroke-miterlimit-zero-expected-mismatch.html: Added.
+        * fast/css/stroke-miterlimit-zero.html: Added.
+
 2017-04-02  Alexey Proskuryakov  <ap@apple.com>
 
         Remove accidentally added DumpJSConsoleLogInStdErr from http/tests/fetch/fetch-in-worker-crash.html expectation.
diff --git a/LayoutTests/fast/css/stroke-miterlimit-default-expected.html b/LayoutTests/fast/css/stroke-miterlimit-default-expected.html
new file mode 100644 (file)
index 0000000..c7063b7
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        div {
+            font-size: 200px;
+            color: gray;
+        }
+
+        .test-stroke {
+            text-shadow: none;
+            -webkit-text-stroke: 30px red;
+        }
+    </style>
+</head>
+<body>
+
+<div class="test-stroke">Miter</div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/css/stroke-miterlimit-default.html b/LayoutTests/fast/css/stroke-miterlimit-default.html
new file mode 100644 (file)
index 0000000..2fd7306
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        div {
+            font-size: 200px;
+            color: gray;
+        }
+
+        .test-stroke {
+            text-shadow: none;
+            -webkit-text-stroke: 30px red;
+        }
+    </style>
+</head>
+<body>
+
+<div class="test-stroke" style="stroke-miterlimit: 4;">Miter</div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/css/stroke-miterlimit-large-expected-mismatch.html b/LayoutTests/fast/css/stroke-miterlimit-large-expected-mismatch.html
new file mode 100644 (file)
index 0000000..c16b8e7
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        div {
+            position: absolute;
+            font-size: 200px;
+            color: gray;
+        }
+
+        .test-stroke {
+            text-shadow: none;
+            -webkit-text-stroke: 30px red;
+        }
+    
+        .obscurer {
+            width: 600px;
+            height: 200px;
+            background-color: blue;
+        }
+    </style>
+</head>
+<body>
+
+<div class="test-stroke" style="stroke-miterlimit: 4;">Miter</div>
+<div class="obscurer" style="left: 0px; top: 20px;"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/css/stroke-miterlimit-large.html b/LayoutTests/fast/css/stroke-miterlimit-large.html
new file mode 100644 (file)
index 0000000..23e0f7b
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        div {
+            position: absolute;
+            font-size: 200px;
+            color: gray;
+        }
+
+        .test-stroke {
+            text-shadow: none;
+            -webkit-text-stroke: 30px red;
+        }
+    
+        .obscurer {
+            width: 600px;
+            height: 200px;
+            background-color: blue;
+        }
+    </style>
+</head>
+<body>
+
+<div class="test-stroke" style="stroke-miterlimit: 10;">Miter</div>
+<div class="obscurer" style="left: 0px; top: 20px;"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/css/stroke-miterlimit-zero-expected-mismatch.html b/LayoutTests/fast/css/stroke-miterlimit-zero-expected-mismatch.html
new file mode 100644 (file)
index 0000000..2fd7306
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        div {
+            font-size: 200px;
+            color: gray;
+        }
+
+        .test-stroke {
+            text-shadow: none;
+            -webkit-text-stroke: 30px red;
+        }
+    </style>
+</head>
+<body>
+
+<div class="test-stroke" style="stroke-miterlimit: 4;">Miter</div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/css/stroke-miterlimit-zero.html b/LayoutTests/fast/css/stroke-miterlimit-zero.html
new file mode 100644 (file)
index 0000000..f3aa53a
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        div {
+            font-size: 200px;
+            color: gray;
+        }
+
+        .test-stroke {
+            text-shadow: none;
+            -webkit-text-stroke: 30px red;
+        }
+    </style>
+</head>
+<body>
+
+<div class="test-stroke" style="stroke-miterlimit: 0;">Miter</div>
+
+</body>
+</html>
index 639f283..f872101 100644 (file)
@@ -1,3 +1,57 @@
+2017-04-03  Per Arne Vollan  <pvollan@apple.com>
+
+        Implement stroke-miterlimit.
+        https://bugs.webkit.org/show_bug.cgi?id=169078
+
+        Reviewed by Dean Jackson.
+
+        Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.
+
+        Tests: fast/css/stroke-miterlimit-default.html
+               fast/css/stroke-miterlimit-large.html
+               fast/css/stroke-miterlimit-zero.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSProperties.json:
+        * css/SVGCSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::svgPropertyValue):
+        * rendering/TextPaintStyle.cpp:
+        (WebCore::computeTextPaintStyle):
+        (WebCore::updateGraphicsContext):
+        * rendering/TextPaintStyle.h:
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::diff):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::strokeMiterLimit):
+        (WebCore::RenderStyle::setStrokeMiterLimit):
+        (WebCore::RenderStyle::initialStrokeMiterLimit):
+        (WebCore::RenderStyle::setStrokeDashOffset):
+        * rendering/style/RenderStyleConstants.cpp:
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/style/SVGRenderStyle.cpp:
+        (WebCore::SVGRenderStyle::diff):
+        * rendering/style/SVGRenderStyle.h:
+        (WebCore::SVGRenderStyle::initialStrokeDashArray):
+        (WebCore::SVGRenderStyle::strokeDashArray):
+        (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
+        (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
+        (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
+        * rendering/style/SVGRenderStyleDefs.cpp:
+        (WebCore::StyleStrokeData::StyleStrokeData):
+        (WebCore::StyleStrokeData::operator==):
+        * rendering/style/SVGRenderStyleDefs.h:
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        (WebCore::StyleRareInheritedData::operator==):
+        * rendering/style/StyleRareInheritedData.h:
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::hasSmoothStroke):
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
+        * rendering/svg/SVGRenderTreeAsText.cpp:
+        (WebCore::writeStyle):
+
 2017-04-03  Alejandro G. Castro  <alex@igalia.com>
 
         [OWR] Fix class structure for the OWR mock classes after last modifications
index 78c0f05..7f8f79c 100644 (file)
@@ -3917,6 +3917,8 @@ RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID,
             return CSSPrimitiveValue::create(style->joinStyle());
         case CSSPropertyStrokeWidth:
             return zoomAdjustedPixelValueForLength(style->strokeWidth(), *style);
+        case CSSPropertyStrokeMiterlimit:
+            return CSSPrimitiveValue::create(style->strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
 
         /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
         case CSSPropertyAll:
@@ -4018,7 +4020,6 @@ RefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID,
         case CSSPropertyShapeRendering:
         case CSSPropertyStroke:
         case CSSPropertyStrokeDasharray:
-        case CSSPropertyStrokeMiterlimit:
         case CSSPropertyStrokeOpacity:
         case CSSPropertyAlignmentBaseline:
         case CSSPropertyBaselineShift:
index 0a104be..b9d6992 100644 (file)
             "inherited": true,
             "codegen-properties": {
                 "name-for-methods": "StrokeMiterLimit",
-                "converter": "Number<float>",
-                "svg": true
+                "converter": "Number<float>"
             },
             "specification": {
                 "category": "svg",
index 8217efb..cb2c0fe 100644 (file)
@@ -113,8 +113,6 @@ RefPtr<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID property
             return CSSPrimitiveValue::create(svgStyle.colorRendering());
         case CSSPropertyShapeRendering:
             return CSSPrimitiveValue::create(svgStyle.shapeRendering());
-        case CSSPropertyStrokeMiterlimit:
-            return CSSPrimitiveValue::create(svgStyle.strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyStrokeOpacity:
             return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyAlignmentBaseline:
index 15ae6a6..8fec00c 100644 (file)
@@ -72,6 +72,7 @@ TextPaintStyle computeTextPaintStyle(const Frame& frame, const RenderStyle& line
     paintStyle.paintOrder = lineStyle.paintOrder();
     paintStyle.lineJoin = lineStyle.joinStyle();
     paintStyle.lineCap = lineStyle.capStyle();
+    paintStyle.miterLimit = lineStyle.strokeMiterLimit();
     
     if (paintInfo.forceTextColor()) {
         paintStyle.fillColor = paintInfo.forcedTextColor();
@@ -200,6 +201,8 @@ void updateGraphicsContext(GraphicsContext& context, const TextPaintStyle& paint
             context.setStrokeThickness(paintStyle.strokeWidth);
         context.setLineJoin(paintStyle.lineJoin);
         context.setLineCap(paintStyle.lineCap);
+        if (paintStyle.lineJoin == MiterJoin)
+            context.setMiterLimit(paintStyle.miterLimit);
     }
 }
 
index df2171a..48723fe 100644 (file)
@@ -52,6 +52,7 @@ struct TextPaintStyle {
     PaintOrder paintOrder { PaintOrder::Normal };
     LineJoin lineJoin { MiterJoin };
     LineCap lineCap { ButtCap };
+    float miterLimit { defaultMiterLimit };
 };
 
 TextPaintStyle computeTextPaintStyle(const Frame&, const RenderStyle&, const PaintInfo&);
index dec0a67..a215618 100644 (file)
@@ -642,6 +642,13 @@ bool RenderStyle::changeRequiresLayout(const RenderStyle& other, unsigned& chang
 
         if (textStrokeWidth() != other.textStrokeWidth())
             return true;
+        
+        // These properties affect the cached stroke bounding box rects.
+        if (m_rareInheritedData->capStyle != other.m_rareInheritedData->capStyle
+            || m_rareInheritedData->joinStyle != other.m_rareInheritedData->joinStyle
+            || m_rareInheritedData->strokeWidth != other.m_rareInheritedData->strokeWidth
+            || m_rareInheritedData->miterLimit != other.m_rareInheritedData->miterLimit)
+            return true;
     }
 
     if (m_inheritedData->lineHeight != other.m_inheritedData->lineHeight
@@ -910,12 +917,6 @@ StyleDifference RenderStyle::diff(const RenderStyle& other, unsigned& changedCon
             return svgChange;
     }
 
-    // These properties affect the cached stroke bounding box rects.
-    if (m_rareInheritedData->capStyle != other.m_rareInheritedData->capStyle
-        || m_rareInheritedData->joinStyle != other.m_rareInheritedData->joinStyle
-        || m_rareInheritedData->strokeWidth != other.m_rareInheritedData->strokeWidth)
-        return StyleDifferenceLayout;
-
     if (changeRequiresLayout(other, changedContextSensitiveProperties))
         return StyleDifferenceLayout;
 
index 2810184..b8beec2 100644 (file)
@@ -1245,7 +1245,7 @@ public:
     void setApplePayButtonType(ApplePayButtonType type) { SET_VAR(m_rareNonInheritedData, applePayButtonType, static_cast<unsigned>(type)); }
 #endif
 
-    // Support for paint-order, stroke-linecap, and stroke-linejoin from https://drafts.fxtf.org/paint/.
+    // Support for paint-order, stroke-linecap, stroke-linejoin, and stroke-miterlimit from https://drafts.fxtf.org/paint/.
     void setPaintOrder(PaintOrder order) { SET_VAR(m_rareInheritedData, paintOrder, static_cast<unsigned>(order)); }
     PaintOrder paintOrder() const { return static_cast<PaintOrder>(m_rareInheritedData->paintOrder); }
     static PaintOrder initialPaintOrder() { return PaintOrder::Normal; }
@@ -1268,7 +1268,11 @@ public:
     bool hasExplicitlySetStrokeWidth() const { return m_rareInheritedData->hasSetStrokeWidth; };
     bool hasPositiveStrokeWidth() const;
     
-    
+    float strokeMiterLimit() const { return m_rareInheritedData->miterLimit; }
+    void setStrokeMiterLimit(float f) { SET_VAR(m_rareInheritedData, miterLimit, f); }
+    static float initialStrokeMiterLimit() { return defaultMiterLimit; }
+
+
     const SVGRenderStyle& svgStyle() const { return m_svgStyle; }
     SVGRenderStyle& accessSVGStyle() { return m_svgStyle.access(); }
 
@@ -1287,8 +1291,6 @@ public:
     void setStrokeDashArray(Vector<SVGLengthValue> array) { accessSVGStyle().setStrokeDashArray(array); }
     const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(); }
     void setStrokeDashOffset(Length&& d) { accessSVGStyle().setStrokeDashOffset(WTFMove(d)); }
-    float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); }
-    void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); }
 
     const Length& cx() const { return svgStyle().cx(); }
     void setCx(Length&& cx) { accessSVGStyle().setCx(WTFMove(cx)); }
index f13cd7b..a395231 100644 (file)
@@ -101,4 +101,6 @@ bool alwaysPageBreak(BreakBetween between)
     return between >= PageBreakBetween;
 }
 
+const float defaultMiterLimit = 4;
+
 } // namespace WebCore
index 20b1564..881699e 100644 (file)
@@ -743,4 +743,6 @@ enum class PaintType {
     Markers
 };
 
+extern const float defaultMiterLimit;
+
 } // namespace WebCore
index c8e55b4..1a0514c 100644 (file)
@@ -188,7 +188,6 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle& other) const
         if (m_strokeData->paintType != other.m_strokeData->paintType
             || m_strokeData->paintColor != other.m_strokeData->paintColor
             || m_strokeData->paintUri != other.m_strokeData->paintUri
-            || m_strokeData->miterLimit != other.m_strokeData->miterLimit
             || m_strokeData->dashArray != other.m_strokeData->dashArray
             || m_strokeData->dashOffset != other.m_strokeData->dashOffset
             || m_strokeData->visitedLinkPaintColor != other.m_strokeData->visitedLinkPaintColor
index 24b5e6f..89854f6 100644 (file)
@@ -71,7 +71,6 @@ public:
     static Color initialStrokePaintColor() { return Color(); }
     static String initialStrokePaintUri() { return String(); }
     static Vector<SVGLengthValue> initialStrokeDashArray() { return { }; }
-    static float initialStrokeMiterLimit() { return 4; }
     static float initialStopOpacity() { return 1; }
     static Color initialStopColor() { return Color(0, 0, 0); }
     static float initialFloodOpacity() { return 1; }
@@ -116,7 +115,6 @@ public:
     void setStrokePaint(SVGPaintType, const Color&, const String& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false);
 
     void setStrokeDashArray(const Vector<SVGLengthValue>&);
-    void setStrokeMiterLimit(float);
     void setStrokeDashOffset(const Length&);
     void setKerning(const SVGLengthValue&);
     void setStopOpacity(float);
@@ -161,7 +159,6 @@ public:
     const Color& strokePaintColor() const { return m_strokeData->paintColor; }
     const String& strokePaintUri() const { return m_strokeData->paintUri; }
     Vector<SVGLengthValue> strokeDashArray() const { return m_strokeData->dashArray; }
-    float strokeMiterLimit() const { return m_strokeData->miterLimit; }
     const Length& strokeDashOffset() const { return m_strokeData->dashOffset; }
     SVGLengthValue kerning() const { return m_textData->kerning; }
     float stopOpacity() const { return m_stopData->opacity; }
@@ -374,12 +371,6 @@ inline void SVGRenderStyle::setStrokeDashArray(const Vector<SVGLengthValue>& arr
         m_strokeData.access().dashArray = array;
 }
 
-inline void SVGRenderStyle::setStrokeMiterLimit(float limit)
-{
-    if (!(m_strokeData->miterLimit == limit))
-        m_strokeData.access().miterLimit = limit;
-}
-
 inline void SVGRenderStyle::setStrokeDashOffset(const Length& offset)
 {
     if (!(m_strokeData->dashOffset == offset))
index 9f023e5..9c206c0 100644 (file)
@@ -76,7 +76,6 @@ bool StyleFillData::operator==(const StyleFillData& other) const
 
 StyleStrokeData::StyleStrokeData()
     : opacity(SVGRenderStyle::initialStrokeOpacity())
-    , miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
     , dashOffset(RenderStyle::initialZeroLength())
     , dashArray(SVGRenderStyle::initialStrokeDashArray())
     , paintType(SVGRenderStyle::initialStrokePaintType())
@@ -91,7 +90,6 @@ StyleStrokeData::StyleStrokeData()
 inline StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
     : RefCounted<StyleStrokeData>()
     , opacity(other.opacity)
-    , miterLimit(other.miterLimit)
     , dashOffset(other.dashOffset)
     , dashArray(other.dashArray)
     , paintType(other.paintType)
@@ -111,7 +109,6 @@ Ref<StyleStrokeData> StyleStrokeData::copy() const
 bool StyleStrokeData::operator==(const StyleStrokeData& other) const
 {
     return opacity == other.opacity
-        && miterLimit == other.miterLimit
         && dashOffset == other.dashOffset
         && dashArray == other.dashArray
         && paintType == other.paintType
index 25a70d3..b28d79d 100644 (file)
@@ -137,7 +137,6 @@ namespace WebCore {
         }
 
         float opacity;
-        float miterLimit;
 
         Length dashOffset;
         Vector<SVGLengthValue> dashArray;
index 0a39b3a..d38baea 100644 (file)
@@ -130,6 +130,7 @@ StyleRareInheritedData::StyleRareInheritedData()
     , joinStyle(RenderStyle::initialJoinStyle())
     , hasSetStrokeWidth(false)
     , strokeWidth(RenderStyle::initialOneLength())
+    , miterLimit(RenderStyle::initialStrokeMiterLimit())
     , hyphenationLimitBefore(-1)
     , hyphenationLimitAfter(-1)
     , hyphenationLimitLines(-1)
@@ -217,6 +218,7 @@ inline StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedDa
     , joinStyle(o.joinStyle)
     , hasSetStrokeWidth(o.hasSetStrokeWidth)
     , strokeWidth(o.strokeWidth)
+    , miterLimit(o.miterLimit)
     , hyphenationString(o.hyphenationString)
     , hyphenationLimitBefore(o.hyphenationLimitBefore)
     , hyphenationLimitAfter(o.hyphenationLimitAfter)
@@ -328,6 +330,7 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
         && joinStyle == o.joinStyle
         && hasSetStrokeWidth == o.hasSetStrokeWidth
         && strokeWidth == o.strokeWidth
+        && miterLimit == o.miterLimit
         && customProperties == o.customProperties
         && arePointingToEqualData(listStyleImage, o.listStyleImage);
 }
index b11a797..f034ad6 100644 (file)
@@ -141,6 +141,7 @@ public:
     unsigned joinStyle : 2; // LineJoin
     unsigned hasSetStrokeWidth : 1;
     Length strokeWidth;    
+    float miterLimit;
 
     AtomicString hyphenationString;
     short hyphenationLimitBefore;
index cd19990..6063d6d 100644 (file)
@@ -445,7 +445,7 @@ bool RenderSVGShape::hasSmoothStroke() const
 {
     const SVGRenderStyle& svgStyle = style().svgStyle();
     return svgStyle.strokeDashArray().isEmpty()
-        && svgStyle.strokeMiterLimit() == svgStyle.initialStrokeMiterLimit()
+        && style().strokeMiterLimit() == style().initialStrokeMiterLimit()
         && style().joinStyle() == style().initialJoinStyle()
         && style().capStyle() == style().initialCapStyle();
 }
index 0113c70..13a62f9 100644 (file)
@@ -431,7 +431,7 @@ void SVGRenderSupport::applyStrokeStyleToContext(GraphicsContext* context, const
     context->setLineCap(style.capStyle());
     context->setLineJoin(style.joinStyle());
     if (style.joinStyle() == MiterJoin)
-        context->setMiterLimit(svgStyle.strokeMiterLimit());
+        context->setMiterLimit(style.strokeMiterLimit());
 
     const Vector<SVGLengthValue>& dashes = svgStyle.strokeDashArray();
     if (dashes.isEmpty())
index 8823bc6..6e0f910 100644 (file)
@@ -196,7 +196,7 @@ static void writeStyle(TextStream& ts, const RenderElement& renderer)
 
             writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f);
             writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0);
-            writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4.0f);
+            writeIfNotDefault(ts, "miter limit", style.strokeMiterLimit(), 4.0f);
             writeIfNotDefault(ts, "line cap", style.capStyle(), ButtCap);
             writeIfNotDefault(ts, "line join", style.joinStyle(), MiterJoin);
             writeIfNotDefault(ts, "dash offset", dashOffset, 0.0);