SVGRenderStyle accessors should return references.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Nov 2013 05:01:08 +0000 (05:01 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Nov 2013 05:01:08 +0000 (05:01 +0000)
<https://webkit.org/b/123656>

RenderStyle::svgStyle() and accessSVGStyle() never return null,
so make them return references instead.

This flushed out a myriad of pointless null checks and assertions.

Reviewed by Anders Carlsson.

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

36 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
Source/WebCore/css/SVGCSSStyleSelector.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/svg/RenderSVGEllipse.cpp
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGPath.cpp
Source/WebCore/rendering/svg/RenderSVGRect.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGShape.h
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/rendering/svg/SVGRenderSupport.cpp
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/rendering/svg/SVGResourcesCache.cpp
Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
Source/WebCore/rendering/svg/SVGTextQuery.cpp
Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEFloodElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/SVGFontData.cpp
Source/WebCore/svg/SVGStopElement.cpp

index 64459de..3908cc4 100644 (file)
@@ -1,3 +1,15 @@
+2013-11-01  Andreas Kling  <akling@apple.com>
+
+        SVGRenderStyle accessors should return references.
+        <https://webkit.org/b/123656>
+
+        RenderStyle::svgStyle() and accessSVGStyle() never return null,
+        so make them return references instead.
+        
+        This flushed out a myriad of pointless null checks and assertions.
+
+        Reviewed by Anders Carlsson.
+
 2013-11-01  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
 
         Removing MediaStreamTrackVector and MediaStreamSourceVector typedefs
index 4c3b06a..a204cb9 100644 (file)
@@ -82,89 +82,87 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID prop
     if (!style)
         return 0;
 
-    const SVGRenderStyle* svgStyle = style->svgStyle();
-    if (!svgStyle)
-        return 0;
+    const SVGRenderStyle& svgStyle = style->svgStyle();
 
     switch (propertyID) {
         case CSSPropertyClipRule:
-            return CSSPrimitiveValue::create(svgStyle->clipRule());
+            return CSSPrimitiveValue::create(svgStyle.clipRule());
         case CSSPropertyFloodOpacity:
-            return CSSPrimitiveValue::create(svgStyle->floodOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(svgStyle.floodOpacity(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyStopOpacity:
-            return CSSPrimitiveValue::create(svgStyle->stopOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(svgStyle.stopOpacity(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyColorInterpolation:
-            return CSSPrimitiveValue::create(svgStyle->colorInterpolation());
+            return CSSPrimitiveValue::create(svgStyle.colorInterpolation());
         case CSSPropertyColorInterpolationFilters:
-            return CSSPrimitiveValue::create(svgStyle->colorInterpolationFilters());
+            return CSSPrimitiveValue::create(svgStyle.colorInterpolationFilters());
         case CSSPropertyFillOpacity:
-            return CSSPrimitiveValue::create(svgStyle->fillOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(svgStyle.fillOpacity(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyFillRule:
-            return CSSPrimitiveValue::create(svgStyle->fillRule());
+            return CSSPrimitiveValue::create(svgStyle.fillRule());
         case CSSPropertyColorRendering:
-            return CSSPrimitiveValue::create(svgStyle->colorRendering());
+            return CSSPrimitiveValue::create(svgStyle.colorRendering());
         case CSSPropertyShapeRendering:
-            return CSSPrimitiveValue::create(svgStyle->shapeRendering());
+            return CSSPrimitiveValue::create(svgStyle.shapeRendering());
         case CSSPropertyStrokeLinecap:
-            return CSSPrimitiveValue::create(svgStyle->capStyle());
+            return CSSPrimitiveValue::create(svgStyle.capStyle());
         case CSSPropertyStrokeLinejoin:
-            return CSSPrimitiveValue::create(svgStyle->joinStyle());
+            return CSSPrimitiveValue::create(svgStyle.joinStyle());
         case CSSPropertyStrokeMiterlimit:
-            return CSSPrimitiveValue::create(svgStyle->strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(svgStyle.strokeMiterLimit(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyStrokeOpacity:
-            return CSSPrimitiveValue::create(svgStyle->strokeOpacity(), CSSPrimitiveValue::CSS_NUMBER);
+            return CSSPrimitiveValue::create(svgStyle.strokeOpacity(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyAlignmentBaseline:
-            return CSSPrimitiveValue::create(svgStyle->alignmentBaseline());
+            return CSSPrimitiveValue::create(svgStyle.alignmentBaseline());
         case CSSPropertyDominantBaseline:
-            return CSSPrimitiveValue::create(svgStyle->dominantBaseline());
+            return CSSPrimitiveValue::create(svgStyle.dominantBaseline());
         case CSSPropertyTextAnchor:
-            return CSSPrimitiveValue::create(svgStyle->textAnchor());
+            return CSSPrimitiveValue::create(svgStyle.textAnchor());
         case CSSPropertyWritingMode:
-            return CSSPrimitiveValue::create(svgStyle->writingMode());
+            return CSSPrimitiveValue::create(svgStyle.writingMode());
         case CSSPropertyClipPath:
-            if (!svgStyle->clipperResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->clipperResource(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle.clipperResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle.clipperResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyMask:
-            if (!svgStyle->maskerResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->maskerResource(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle.maskerResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle.maskerResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyFilter:
-            if (!svgStyle->filterResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->filterResource(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle.filterResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle.filterResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyFloodColor:
-            return currentColorOrValidColor(style, svgStyle->floodColor());
+            return currentColorOrValidColor(style, svgStyle.floodColor());
         case CSSPropertyLightingColor:
-            return currentColorOrValidColor(style, svgStyle->lightingColor());
+            return currentColorOrValidColor(style, svgStyle.lightingColor());
         case CSSPropertyStopColor:
-            return currentColorOrValidColor(style, svgStyle->stopColor());
+            return currentColorOrValidColor(style, svgStyle.stopColor());
         case CSSPropertyFill:
-            return adjustSVGPaintForCurrentColor(SVGPaint::create(svgStyle->fillPaintType(), svgStyle->fillPaintUri(), svgStyle->fillPaintColor()), style);
+            return adjustSVGPaintForCurrentColor(SVGPaint::create(svgStyle.fillPaintType(), svgStyle.fillPaintUri(), svgStyle.fillPaintColor()), style);
         case CSSPropertyKerning:
-            return SVGLength::toCSSPrimitiveValue(svgStyle->kerning());
+            return SVGLength::toCSSPrimitiveValue(svgStyle.kerning());
         case CSSPropertyMarkerEnd:
-            if (!svgStyle->markerEndResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->markerEndResource(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle.markerEndResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle.markerEndResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyMarkerMid:
-            if (!svgStyle->markerMidResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->markerMidResource(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle.markerMidResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle.markerMidResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyMarkerStart:
-            if (!svgStyle->markerStartResource().isEmpty())
-                return CSSPrimitiveValue::create(svgStyle->markerStartResource(), CSSPrimitiveValue::CSS_URI);
+            if (!svgStyle.markerStartResource().isEmpty())
+                return CSSPrimitiveValue::create(svgStyle.markerStartResource(), CSSPrimitiveValue::CSS_URI);
             return CSSPrimitiveValue::createIdentifier(CSSValueNone);
         case CSSPropertyStroke:
-            return adjustSVGPaintForCurrentColor(SVGPaint::create(svgStyle->strokePaintType(), svgStyle->strokePaintUri(), svgStyle->strokePaintColor()), style);
+            return adjustSVGPaintForCurrentColor(SVGPaint::create(svgStyle.strokePaintType(), svgStyle.strokePaintUri(), svgStyle.strokePaintColor()), style);
         case CSSPropertyStrokeDasharray:
-            return strokeDashArrayToCSSValueList(svgStyle->strokeDashArray());
+            return strokeDashArrayToCSSValueList(svgStyle.strokeDashArray());
         case CSSPropertyStrokeDashoffset:
-            return SVGLength::toCSSPrimitiveValue(svgStyle->strokeDashOffset());
+            return SVGLength::toCSSPrimitiveValue(svgStyle.strokeDashOffset());
         case CSSPropertyStrokeWidth:
-            return SVGLength::toCSSPrimitiveValue(svgStyle->strokeWidth());
+            return SVGLength::toCSSPrimitiveValue(svgStyle.strokeWidth());
         case CSSPropertyBaselineShift: {
-            switch (svgStyle->baselineShift()) {
+            switch (svgStyle.baselineShift()) {
                 case BS_BASELINE:
                     return CSSPrimitiveValue::createIdentifier(CSSValueBaseline);
                 case BS_SUPER:
@@ -172,30 +170,30 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID prop
                 case BS_SUB:
                     return CSSPrimitiveValue::createIdentifier(CSSValueSub);
                 case BS_LENGTH:
-                    return SVGLength::toCSSPrimitiveValue(svgStyle->baselineShiftValue());
+                    return SVGLength::toCSSPrimitiveValue(svgStyle.baselineShiftValue());
             }
             ASSERT_NOT_REACHED();
             return 0;
         }
         case CSSPropertyBufferedRendering:
-            return CSSPrimitiveValue::create(svgStyle->bufferedRendering());
+            return CSSPrimitiveValue::create(svgStyle.bufferedRendering());
         case CSSPropertyGlyphOrientationHorizontal:
-            return glyphOrientationToCSSPrimitiveValue(svgStyle->glyphOrientationHorizontal());
+            return glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationHorizontal());
         case CSSPropertyGlyphOrientationVertical: {
-            if (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitiveValue(svgStyle->glyphOrientationVertical()))
+            if (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitiveValue(svgStyle.glyphOrientationVertical()))
                 return value.release();
 
-            if (svgStyle->glyphOrientationVertical() == GO_AUTO)
+            if (svgStyle.glyphOrientationVertical() == GO_AUTO)
                 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
 
             return 0;
         }
         case CSSPropertyWebkitSvgShadow:
-            return valueForShadow(svgStyle->shadow(), propertyID, style);
+            return valueForShadow(svgStyle.shadow(), propertyID, style);
         case CSSPropertyVectorEffect:
-            return CSSPrimitiveValue::create(svgStyle->vectorEffect());
+            return CSSPrimitiveValue::create(svgStyle.vectorEffect());
         case CSSPropertyMaskType:
-            return CSSPrimitiveValue::create(svgStyle->maskType());
+            return CSSPrimitiveValue::create(svgStyle.maskType());
         case CSSPropertyMarker:
         case CSSPropertyEnableBackground:
         case CSSPropertyColorProfile:
index be66cef..4a35ad6 100644 (file)
 #define HANDLE_INHERIT(prop, Prop) \
 if (isInherit) \
 { \
-    svgstyle->set##Prop(state.parentStyle()->svgStyle()->prop()); \
+    svgStyle.set##Prop(state.parentStyle()->svgStyle().prop()); \
     return; \
 }
 
 #define HANDLE_INHERIT_AND_INITIAL(prop, Prop) \
 HANDLE_INHERIT(prop, Prop) \
 if (isInitial) { \
-    svgstyle->set##Prop(SVGRenderStyle::initial##Prop()); \
+    svgStyle.set##Prop(SVGRenderStyle::initial##Prop()); \
     return; \
 }
 
@@ -110,7 +110,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
         primitiveValue = toCSSPrimitiveValue(value);
 
     const State& state = m_state;
-    SVGRenderStyle* svgstyle = state.style()->accessSVGStyle();
+    SVGRenderStyle& svgStyle = state.style()->accessSVGStyle();
 
     bool isInherit = state.parentNode() && value->isInheritedValue();
     bool isInitial = value->isInitialValue() || (!state.parentNode() && value->isInheritedValue());
@@ -128,7 +128,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (!primitiveValue)
                 break;
 
-            svgstyle->setAlignmentBaseline(*primitiveValue);
+            svgStyle.setAlignmentBaseline(*primitiveValue);
             break;
         }
         case CSSPropertyBaselineShift:
@@ -140,20 +140,20 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (primitiveValue->getValueID()) {
                 switch (primitiveValue->getValueID()) {
                 case CSSValueBaseline:
-                    svgstyle->setBaselineShift(BS_BASELINE);
+                    svgStyle.setBaselineShift(BS_BASELINE);
                     break;
                 case CSSValueSub:
-                    svgstyle->setBaselineShift(BS_SUB);
+                    svgStyle.setBaselineShift(BS_SUB);
                     break;
                 case CSSValueSuper:
-                    svgstyle->setBaselineShift(BS_SUPER);
+                    svgStyle.setBaselineShift(BS_SUPER);
                     break;
                 default:
                     break;
                 }
             } else {
-                svgstyle->setBaselineShift(BS_LENGTH);
-                svgstyle->setBaselineShiftValue(SVGLength::fromCSSPrimitiveValue(primitiveValue));
+                svgStyle.setBaselineShift(BS_LENGTH);
+                svgStyle.setBaselineShiftValue(SVGLength::fromCSSPrimitiveValue(primitiveValue));
             }
 
             break;
@@ -162,28 +162,28 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
         {
             HANDLE_INHERIT_AND_INITIAL(kerning, Kerning);
             if (primitiveValue)
-                svgstyle->setKerning(SVGLength::fromCSSPrimitiveValue(primitiveValue));
+                svgStyle.setKerning(SVGLength::fromCSSPrimitiveValue(primitiveValue));
             break;
         }
         case CSSPropertyDominantBaseline:
         {
             HANDLE_INHERIT_AND_INITIAL(dominantBaseline, DominantBaseline)
             if (primitiveValue)
-                svgstyle->setDominantBaseline(*primitiveValue);
+                svgStyle.setDominantBaseline(*primitiveValue);
             break;
         }
         case CSSPropertyColorInterpolation:
         {
             HANDLE_INHERIT_AND_INITIAL(colorInterpolation, ColorInterpolation)
             if (primitiveValue)
-                svgstyle->setColorInterpolation(*primitiveValue);
+                svgStyle.setColorInterpolation(*primitiveValue);
             break;
         }
         case CSSPropertyColorInterpolationFilters:
         {
             HANDLE_INHERIT_AND_INITIAL(colorInterpolationFilters, ColorInterpolationFilters)
             if (primitiveValue)
-                svgstyle->setColorInterpolationFilters(*primitiveValue);
+                svgStyle.setColorInterpolationFilters(*primitiveValue);
             break;
         }
         case CSSPropertyColorProfile:
@@ -195,69 +195,69 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
         {
             HANDLE_INHERIT_AND_INITIAL(colorRendering, ColorRendering)
             if (primitiveValue)
-                svgstyle->setColorRendering(*primitiveValue);
+                svgStyle.setColorRendering(*primitiveValue);
             break;
         }
         case CSSPropertyClipRule:
         {
             HANDLE_INHERIT_AND_INITIAL(clipRule, ClipRule)
             if (primitiveValue)
-                svgstyle->setClipRule(*primitiveValue);
+                svgStyle.setClipRule(*primitiveValue);
             break;
         }
         case CSSPropertyFillRule:
         {
             HANDLE_INHERIT_AND_INITIAL(fillRule, FillRule)
             if (primitiveValue)
-                svgstyle->setFillRule(*primitiveValue);
+                svgStyle.setFillRule(*primitiveValue);
             break;
         }
         case CSSPropertyStrokeLinejoin:
         {
             HANDLE_INHERIT_AND_INITIAL(joinStyle, JoinStyle)
             if (primitiveValue)
-                svgstyle->setJoinStyle(*primitiveValue);
+                svgStyle.setJoinStyle(*primitiveValue);
             break;
         }
         case CSSPropertyShapeRendering:
         {
             HANDLE_INHERIT_AND_INITIAL(shapeRendering, ShapeRendering)
             if (primitiveValue)
-                svgstyle->setShapeRendering(*primitiveValue);
+                svgStyle.setShapeRendering(*primitiveValue);
             break;
         }
         // end of ident only properties
         case CSSPropertyFill:
         {
             if (isInherit) {
-                const SVGRenderStyle* svgParentStyle = state.parentStyle()->svgStyle();
-                svgstyle->setFillPaint(svgParentStyle->fillPaintType(), svgParentStyle->fillPaintColor(), svgParentStyle->fillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
+                const SVGRenderStyle& svgParentStyle = state.parentStyle()->svgStyle();
+                svgStyle.setFillPaint(svgParentStyle.fillPaintType(), svgParentStyle.fillPaintColor(), svgParentStyle.fillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
                 return;
             }
             if (isInitial) {
-                svgstyle->setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
+                svgStyle.setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
                 return;
             }
             if (value->isSVGPaint()) {
                 SVGPaint* svgPaint = toSVGPaint(value);
-                svgstyle->setFillPaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
+                svgStyle.setFillPaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
             }
             break;
         }
         case CSSPropertyStroke:
         {
             if (isInherit) {
-                const SVGRenderStyle* svgParentStyle = state.parentStyle()->svgStyle();
-                svgstyle->setStrokePaint(svgParentStyle->strokePaintType(), svgParentStyle->strokePaintColor(), svgParentStyle->strokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
+                const SVGRenderStyle& svgParentStyle = state.parentStyle()->svgStyle();
+                svgStyle.setStrokePaint(svgParentStyle.strokePaintType(), svgParentStyle.strokePaintColor(), svgParentStyle.strokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
                 return;
             }
             if (isInitial) {
-                svgstyle->setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
+                svgStyle.setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
                 return;
             }
             if (value->isSVGPaint()) {
                 SVGPaint* svgPaint = toSVGPaint(value);
-                svgstyle->setStrokePaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
+                svgStyle.setStrokePaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
             }
             break;
         }
@@ -265,14 +265,14 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
         {
             HANDLE_INHERIT_AND_INITIAL(strokeWidth, StrokeWidth)
             if (primitiveValue)
-                svgstyle->setStrokeWidth(SVGLength::fromCSSPrimitiveValue(primitiveValue));
+                svgStyle.setStrokeWidth(SVGLength::fromCSSPrimitiveValue(primitiveValue));
             break;
         }
         case CSSPropertyStrokeDasharray:
         {
             HANDLE_INHERIT_AND_INITIAL(strokeDashArray, StrokeDashArray)
             if (!value->isValueList()) {
-                svgstyle->setStrokeDashArray(SVGRenderStyle::initialStrokeDashArray());
+                svgStyle.setStrokeDashArray(SVGRenderStyle::initialStrokeDashArray());
                 break;
             }
 
@@ -289,14 +289,14 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
                 array.append(SVGLength::fromCSSPrimitiveValue(dash));
             }
 
-            svgstyle->setStrokeDashArray(array);
+            svgStyle.setStrokeDashArray(array);
             break;
         }
         case CSSPropertyStrokeDashoffset:
         {
             HANDLE_INHERIT_AND_INITIAL(strokeDashOffset, StrokeDashOffset)
             if (primitiveValue)
-                svgstyle->setStrokeDashOffset(SVGLength::fromCSSPrimitiveValue(primitiveValue));
+                svgStyle.setStrokeDashOffset(SVGLength::fromCSSPrimitiveValue(primitiveValue));
             break;
         }
         case CSSPropertyFillOpacity:
@@ -314,7 +314,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             else
                 return;
 
-            svgstyle->setFillOpacity(f);
+            svgStyle.setFillOpacity(f);
             break;
         }
         case CSSPropertyStrokeOpacity:
@@ -332,7 +332,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             else
                 return;
 
-            svgstyle->setStrokeOpacity(f);
+            svgStyle.setStrokeOpacity(f);
             break;
         }
         case CSSPropertyStopOpacity:
@@ -350,7 +350,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             else
                 return;
 
-            svgstyle->setStopOpacity(f);
+            svgStyle.setStopOpacity(f);
             break;
         }
         case CSSPropertyMarkerStart:
@@ -364,7 +364,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (type == CSSPrimitiveValue::CSS_URI)
                 s = primitiveValue->getStringValue();
 
-            svgstyle->setMarkerStartResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
+            svgStyle.setMarkerStartResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
             break;
         }
         case CSSPropertyMarkerMid:
@@ -378,7 +378,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (type == CSSPrimitiveValue::CSS_URI)
                 s = primitiveValue->getStringValue();
 
-            svgstyle->setMarkerMidResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
+            svgStyle.setMarkerMidResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
             break;
         }
         case CSSPropertyMarkerEnd:
@@ -392,14 +392,14 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (type == CSSPrimitiveValue::CSS_URI)
                 s = primitiveValue->getStringValue();
 
-            svgstyle->setMarkerEndResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
+            svgStyle.setMarkerEndResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
             break;
         }
         case CSSPropertyStrokeLinecap:
         {
             HANDLE_INHERIT_AND_INITIAL(capStyle, CapStyle)
             if (primitiveValue)
-                svgstyle->setCapStyle(*primitiveValue);
+                svgStyle.setCapStyle(*primitiveValue);
             break;
         }
         case CSSPropertyStrokeMiterlimit:
@@ -415,7 +415,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             else
                 return;
 
-            svgstyle->setStrokeMiterLimit(f);
+            svgStyle.setStrokeMiterLimit(f);
             break;
         }
         case CSSPropertyFilter:
@@ -429,7 +429,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (type == CSSPrimitiveValue::CSS_URI)
                 s = primitiveValue->getStringValue();
 
-            svgstyle->setFilterResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
+            svgStyle.setFilterResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
             break;
         }
         case CSSPropertyMask:
@@ -443,7 +443,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (type == CSSPrimitiveValue::CSS_URI)
                 s = primitiveValue->getStringValue();
 
-            svgstyle->setMaskerResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
+            svgStyle.setMaskerResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
             break;
         }
         case CSSPropertyClipPath:
@@ -457,35 +457,35 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (type == CSSPrimitiveValue::CSS_URI)
                 s = primitiveValue->getStringValue();
 
-            svgstyle->setClipperResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
+            svgStyle.setClipperResource(SVGURIReference::fragmentIdentifierFromIRIString(s, state.document()));
             break;
         }
         case CSSPropertyTextAnchor:
         {
             HANDLE_INHERIT_AND_INITIAL(textAnchor, TextAnchor)
             if (primitiveValue)
-                svgstyle->setTextAnchor(*primitiveValue);
+                svgStyle.setTextAnchor(*primitiveValue);
             break;
         }
         case CSSPropertyWritingMode:
         {
             HANDLE_INHERIT_AND_INITIAL(writingMode, WritingMode)
             if (primitiveValue)
-                svgstyle->setWritingMode(*primitiveValue);
+                svgStyle.setWritingMode(*primitiveValue);
             break;
         }
         case CSSPropertyStopColor:
         {
             HANDLE_INHERIT_AND_INITIAL(stopColor, StopColor);
             if (value->isSVGColor())
-                svgstyle->setStopColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()->color()));
+                svgStyle.setStopColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()->color()));
             break;
         }
        case CSSPropertyLightingColor:
         {
             HANDLE_INHERIT_AND_INITIAL(lightingColor, LightingColor);
             if (value->isSVGColor())
-                svgstyle->setLightingColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()->color()));
+                svgStyle.setLightingColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()->color()));
             break;
         }
         case CSSPropertyFloodOpacity:
@@ -503,14 +503,14 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             else
                 return;
 
-            svgstyle->setFloodOpacity(f);
+            svgStyle.setFloodOpacity(f);
             break;
         }
         case CSSPropertyFloodColor:
         {
             HANDLE_INHERIT_AND_INITIAL(floodColor, FloodColor);
             if (value->isSVGColor())
-                svgstyle->setFloodColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()->color()));
+                svgStyle.setFloodColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()->color()));
             break;
         }
         case CSSPropertyGlyphOrientationHorizontal:
@@ -523,7 +523,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
                 int orientation = angleToGlyphOrientation(primitiveValue->getFloatValue());
                 ASSERT(orientation != -1);
 
-                svgstyle->setGlyphOrientationHorizontal((EGlyphOrientation) orientation);
+                svgStyle.setGlyphOrientationHorizontal((EGlyphOrientation) orientation);
             }
 
             break;
@@ -538,9 +538,9 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
                 int orientation = angleToGlyphOrientation(primitiveValue->getFloatValue());
                 ASSERT(orientation != -1);
 
-                svgstyle->setGlyphOrientationVertical((EGlyphOrientation) orientation);
+                svgStyle.setGlyphOrientationVertical((EGlyphOrientation) orientation);
             } else if (primitiveValue->getValueID() == CSSValueAuto)
-                svgstyle->setGlyphOrientationVertical(GO_AUTO);
+                svgStyle.setGlyphOrientationVertical(GO_AUTO);
 
             break;
         }
@@ -550,9 +550,9 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             break;
         case CSSPropertyWebkitSvgShadow: {
             if (isInherit)
-                return svgstyle->setShadow(adoptPtr(state.parentStyle()->svgStyle()->shadow() ? new ShadowData(*state.parentStyle()->svgStyle()->shadow()) : 0));
+                return svgStyle.setShadow(adoptPtr(state.parentStyle()->svgStyle().shadow() ? new ShadowData(*state.parentStyle()->svgStyle().shadow()) : 0));
             if (isInitial || primitiveValue) // initial | none
-                return svgstyle->setShadow(nullptr);
+                return svgStyle.setShadow(nullptr);
 
             if (!value->isValueList())
                 return;
@@ -577,7 +577,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             ASSERT(!item->style);
 
             OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(location, blur, 0, Normal, false, color.isValid() ? color : Color::transparent));
-            svgstyle->setShadow(shadowData.release());
+            svgStyle.setShadow(shadowData.release());
             return;
         }
         case CSSPropertyVectorEffect: {
@@ -585,7 +585,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (!primitiveValue)
                 break;
 
-            svgstyle->setVectorEffect(*primitiveValue);
+            svgStyle.setVectorEffect(*primitiveValue);
             break;
         }
         case CSSPropertyBufferedRendering: {
@@ -593,7 +593,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (!primitiveValue)
                 break;
 
-            svgstyle->setBufferedRendering(*primitiveValue);
+            svgStyle.setBufferedRendering(*primitiveValue);
             break;
         }
         case CSSPropertyMaskType: {
@@ -601,7 +601,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
             if (!primitiveValue)
                 break;
 
-            svgstyle->setMaskType(*primitiveValue);
+            svgStyle.setMaskType(*primitiveValue);
             break;
         }
         default:
index 38ada30..0f08de2 100644 (file)
@@ -1469,43 +1469,43 @@ public:
     void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
 
 #if ENABLE(SVG)
-    const SVGRenderStyle* svgStyle() const { return m_svgStyle.get(); }
-    SVGRenderStyle* accessSVGStyle() { return m_svgStyle.access(); }
-
-    const SVGPaint::SVGPaintType& fillPaintType() const { return svgStyle()->fillPaintType(); }
-    Color fillPaintColor() const { return svgStyle()->fillPaintColor(); }
-    void setFillPaintColor(const Color& c) { accessSVGStyle()->setFillPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
-    float fillOpacity() const { return svgStyle()->fillOpacity(); }
-    void setFillOpacity(float f) { accessSVGStyle()->setFillOpacity(f); }
-
-    const SVGPaint::SVGPaintType& strokePaintType() const { return svgStyle()->strokePaintType(); }
-    Color strokePaintColor() const { return svgStyle()->strokePaintColor(); }
-    void setStrokePaintColor(const Color& c) { accessSVGStyle()->setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
-    float strokeOpacity() const { return svgStyle()->strokeOpacity(); }
-    void setStrokeOpacity(float f) { accessSVGStyle()->setStrokeOpacity(f); }
-    SVGLength strokeWidth() const { return svgStyle()->strokeWidth(); }
-    void setStrokeWidth(SVGLength w) { accessSVGStyle()->setStrokeWidth(w); }
-    Vector<SVGLength> strokeDashArray() const { return svgStyle()->strokeDashArray(); }
-    void setStrokeDashArray(Vector<SVGLength> array) { accessSVGStyle()->setStrokeDashArray(array); }
-    SVGLength strokeDashOffset() const { return svgStyle()->strokeDashOffset(); }
-    void setStrokeDashOffset(SVGLength d) { accessSVGStyle()->setStrokeDashOffset(d); }
-    float strokeMiterLimit() const { return svgStyle()->strokeMiterLimit(); }
-    void setStrokeMiterLimit(float f) { accessSVGStyle()->setStrokeMiterLimit(f); }
-
-    float floodOpacity() const { return svgStyle()->floodOpacity(); }
-    void setFloodOpacity(float f) { accessSVGStyle()->setFloodOpacity(f); }
-
-    float stopOpacity() const { return svgStyle()->stopOpacity(); }
-    void setStopOpacity(float f) { accessSVGStyle()->setStopOpacity(f); }
-
-    void setStopColor(const Color& c) { accessSVGStyle()->setStopColor(c); }
-    void setFloodColor(const Color& c) { accessSVGStyle()->setFloodColor(c); }
-    void setLightingColor(const Color& c) { accessSVGStyle()->setLightingColor(c); }
-
-    SVGLength baselineShiftValue() const { return svgStyle()->baselineShiftValue(); }
-    void setBaselineShiftValue(SVGLength s) { accessSVGStyle()->setBaselineShiftValue(s); }
-    SVGLength kerning() const { return svgStyle()->kerning(); }
-    void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); }
+    const SVGRenderStyle& svgStyle() const { return *m_svgStyle; }
+    SVGRenderStyle& accessSVGStyle() { return *m_svgStyle.access(); }
+
+    const SVGPaint::SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(); }
+    Color fillPaintColor() const { return svgStyle().fillPaintColor(); }
+    void setFillPaintColor(const Color& c) { accessSVGStyle().setFillPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
+    float fillOpacity() const { return svgStyle().fillOpacity(); }
+    void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); }
+
+    const SVGPaint::SVGPaintType& strokePaintType() const { return svgStyle().strokePaintType(); }
+    Color strokePaintColor() const { return svgStyle().strokePaintColor(); }
+    void setStrokePaintColor(const Color& c) { accessSVGStyle().setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
+    float strokeOpacity() const { return svgStyle().strokeOpacity(); }
+    void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); }
+    SVGLength strokeWidth() const { return svgStyle().strokeWidth(); }
+    void setStrokeWidth(SVGLength w) { accessSVGStyle().setStrokeWidth(w); }
+    Vector<SVGLength> strokeDashArray() const { return svgStyle().strokeDashArray(); }
+    void setStrokeDashArray(Vector<SVGLength> array) { accessSVGStyle().setStrokeDashArray(array); }
+    SVGLength strokeDashOffset() const { return svgStyle().strokeDashOffset(); }
+    void setStrokeDashOffset(SVGLength d) { accessSVGStyle().setStrokeDashOffset(d); }
+    float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); }
+    void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); }
+
+    float floodOpacity() const { return svgStyle().floodOpacity(); }
+    void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); }
+
+    float stopOpacity() const { return svgStyle().stopOpacity(); }
+    void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); }
+
+    void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); }
+    void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); }
+    void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c); }
+
+    SVGLength baselineShiftValue() const { return svgStyle().baselineShiftValue(); }
+    void setBaselineShiftValue(SVGLength s) { accessSVGStyle().setBaselineShiftValue(s); }
+    SVGLength kerning() const { return svgStyle().kerning(); }
+    void setKerning(SVGLength k) { accessSVGStyle().setKerning(k); }
 #endif
 
 #if ENABLE(CSS_SHAPES)
@@ -1915,9 +1915,9 @@ private:
     Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
 
 #if ENABLE(SVG)
-    Color stopColor() const { return svgStyle()->stopColor(); }
-    Color floodColor() const { return svgStyle()->floodColor(); }
-    Color lightingColor() const { return svgStyle()->lightingColor(); }
+    Color stopColor() const { return svgStyle().stopColor(); }
+    Color floodColor() const { return svgStyle().floodColor(); }
+    Color lightingColor() const { return svgStyle().lightingColor(); }
 #endif
 
     void appendContent(std::unique_ptr<ContentData>);
index 39813cc..1d16e9f 100644 (file)
@@ -71,7 +71,7 @@ void RenderSVGEllipse::updateShapeFromElement()
 
     m_fillBoundingBox = FloatRect(m_center.x() - m_radii.width(), m_center.y() - m_radii.height(), 2 * m_radii.width(), 2 * m_radii.height());
     m_strokeBoundingBox = m_fillBoundingBox;
-    if (style().svgStyle()->hasStroke())
+    if (style().svgStyle().hasStroke())
         m_strokeBoundingBox.inflate(strokeWidth() / 2);
 }
 
@@ -105,7 +105,7 @@ void RenderSVGEllipse::fillShape(GraphicsContext* context) const
 
 void RenderSVGEllipse::strokeShape(GraphicsContext* context) const
 {
-    if (!style().svgStyle()->hasVisibleStroke())
+    if (!style().svgStyle().hasVisibleStroke())
         return;
     if (m_usePathFallback) {
         RenderSVGShape::strokeShape(context);
index f2e8cc7..f29c719 100644 (file)
@@ -137,7 +137,7 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&)
             SVGRenderingContext renderingContext(*this, childPaintInfo);
 
             if (renderingContext.isRenderingPrepared()) {
-                if (style().svgStyle()->bufferedRendering() == BR_STATIC  && renderingContext.bufferForeground(m_bufferedForeground))
+                if (style().svgStyle().bufferedRendering() == BR_STATIC  && renderingContext.bufferForeground(m_bufferedForeground))
                     return;
 
                 paintForeground(childPaintInfo);
index 5249ea9..b2fe40d 100644 (file)
@@ -57,7 +57,7 @@ FloatRect RenderSVGPath::calculateUpdatedStrokeBoundingBox() const
 {
     FloatRect strokeBoundingBox = m_strokeBoundingBox;
 
-    if (style().svgStyle()->hasStroke()) {
+    if (style().svgStyle().hasStroke()) {
         // FIXME: zero-length subpaths do not respect vector-effect = non-scaling-stroke.
         float strokeWidth = this->strokeWidth();
         for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i)
@@ -79,7 +79,7 @@ static void useStrokeStyleToFill(GraphicsContext* context)
 
 void RenderSVGPath::strokeShape(GraphicsContext* context) const
 {
-    if (!style().svgStyle()->hasVisibleStroke())
+    if (!style().svgStyle().hasVisibleStroke())
         return;
 
     RenderSVGShape::strokeShape(context);
@@ -108,15 +108,15 @@ bool RenderSVGPath::shapeDependentStrokeContains(const FloatPoint& point)
     if (RenderSVGShape::shapeDependentStrokeContains(point))
         return true;
 
-    const SVGRenderStyle* svgStyle = style().svgStyle();
+    const SVGRenderStyle& svgStyle = style().svgStyle();
     for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) {
-        ASSERT(svgStyle->hasStroke());
+        ASSERT(svgStyle.hasStroke());
         float strokeWidth = this->strokeWidth();
-        if (svgStyle->capStyle() == SquareCap) {
+        if (svgStyle.capStyle() == SquareCap) {
             if (zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth).contains(point))
                 return true;
         } else {
-            ASSERT(svgStyle->capStyle() == RoundCap);
+            ASSERT(svgStyle.capStyle() == RoundCap);
             FloatPoint radiusVector(point.x() - m_zeroLengthLinecapLocations[i].x(), point.y() -  m_zeroLengthLinecapLocations[i].y());
             if (radiusVector.lengthSquared() < strokeWidth * strokeWidth * .25f)
                 return true;
@@ -129,7 +129,7 @@ bool RenderSVGPath::shouldStrokeZeroLengthSubpath() const
 {
     // Spec(11.4): Any zero length subpath shall not be stroked if the "stroke-linecap" property has a value of butt
     // but shall be stroked if the "stroke-linecap" property has a value of round or square
-    return style().svgStyle()->hasStroke() && style().svgStyle()->capStyle() != ButtCap;
+    return style().svgStyle().hasStroke() && style().svgStyle().capStyle() != ButtCap;
 }
 
 Path* RenderSVGPath::zeroLengthLinecapPath(const FloatPoint& linecapPosition) const
@@ -137,7 +137,7 @@ Path* RenderSVGPath::zeroLengthLinecapPath(const FloatPoint& linecapPosition) co
     DEFINE_STATIC_LOCAL(Path, tempPath, ());
 
     tempPath.clear();
-    if (style().svgStyle()->capStyle() == SquareCap)
+    if (style().svgStyle().capStyle() == SquareCap)
         tempPath.addRect(zeroLengthSubpathRect(linecapPosition, this->strokeWidth()));
     else
         tempPath.addEllipse(zeroLengthSubpathRect(linecapPosition, this->strokeWidth()));
index 29313b0..22446be 100644 (file)
@@ -78,7 +78,7 @@ void RenderSVGRect::updateShapeFromElement()
     m_innerStrokeRect = m_fillBoundingBox;
     m_outerStrokeRect = m_fillBoundingBox;
 
-    if (style().svgStyle()->hasStroke()) {
+    if (style().svgStyle().hasStroke()) {
         float strokeWidth = this->strokeWidth();
         m_innerStrokeRect.inflate(-strokeWidth / 2);
         m_outerStrokeRect.inflate(strokeWidth / 2);
@@ -88,7 +88,7 @@ void RenderSVGRect::updateShapeFromElement()
 
 #if USE(CG)
     // CoreGraphics can inflate the stroke by 1px when drawing a rectangle with antialiasing disabled at non-integer coordinates, we need to compensate.
-    if (style().svgStyle()->shapeRendering() == SR_CRISPEDGES)
+    if (style().svgStyle().shapeRendering() == SR_CRISPEDGES)
         m_strokeBoundingBox.inflate(1);
 #endif
 }
@@ -118,7 +118,7 @@ void RenderSVGRect::fillShape(GraphicsContext* context) const
 
 void RenderSVGRect::strokeShape(GraphicsContext* context) const
 {
-    if (!style().svgStyle()->hasVisibleStroke())
+    if (!style().svgStyle().hasVisibleStroke())
         return;
 
     if (m_usePathFallback) {
index 956f92c..fd3e63c 100644 (file)
@@ -45,8 +45,8 @@ static inline bool inheritColorFromParentStyleIfNeeded(RenderElement& object, bo
         return true;
     if (!object.parent())
         return false;
-    const SVGRenderStyle* parentSVGStyle = object.parent()->style().svgStyle();
-    color = applyToFill ? parentSVGStyle->fillPaintColor() : parentSVGStyle->strokePaintColor();
+    const SVGRenderStyle& parentSVGStyle = object.parent()->style().svgStyle();
+    color = applyToFill ? parentSVGStyle.fillPaintColor() : parentSVGStyle.strokePaintColor();
     return true;
 }
 
@@ -55,9 +55,7 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
     ASSERT(style);
 
     // If we have no style at all, ignore it.
-    const SVGRenderStyle* svgStyle = style->svgStyle();
-    if (!svgStyle)
-        return 0;
+    const SVGRenderStyle& svgStyle = style->svgStyle();
 
     bool isRenderingMask = object.view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask;
 
@@ -70,15 +68,15 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
             return colorResource;
         }
 
-        if (!svgStyle->hasFill())
+        if (!svgStyle.hasFill())
             return 0;
     } else {
-        if (!svgStyle->hasStroke() || isRenderingMask)
+        if (!svgStyle.hasStroke() || isRenderingMask)
             return 0;
     }
 
     bool applyToFill = mode == ApplyToFillMode;
-    SVGPaint::SVGPaintType paintType = applyToFill ? svgStyle->fillPaintType() : svgStyle->strokePaintType();
+    SVGPaint::SVGPaintType paintType = applyToFill ? svgStyle.fillPaintType() : svgStyle.strokePaintType();
     if (paintType == SVGPaint::SVG_PAINTTYPE_NONE)
         return 0;
 
@@ -90,18 +88,18 @@ static inline RenderSVGResource* requestPaintingResource(RenderSVGResourceMode m
     case SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR:
     case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR:
     case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR:
-        color = applyToFill ? svgStyle->fillPaintColor() : svgStyle->strokePaintColor();
+        color = applyToFill ? svgStyle.fillPaintColor() : svgStyle.strokePaintColor();
     default:
         break;
     }
 
     if (style->insideLink() == InsideVisitedLink) {
         // FIXME: This code doesn't support the uri component of the visited link paint, https://bugs.webkit.org/show_bug.cgi?id=70006
-        SVGPaint::SVGPaintType visitedPaintType = applyToFill ? svgStyle->visitedLinkFillPaintType() : svgStyle->visitedLinkStrokePaintType();
+        SVGPaint::SVGPaintType visitedPaintType = applyToFill ? svgStyle.visitedLinkFillPaintType() : svgStyle.visitedLinkStrokePaintType();
 
         // For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'.
         if (visitedPaintType < SVGPaint::SVG_PAINTTYPE_URI_NONE && visitedPaintType != SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR) {
-            const Color& visitedColor = applyToFill ? svgStyle->visitedLinkFillPaintColor() : svgStyle->visitedLinkStrokePaintColor();
+            const Color& visitedColor = applyToFill ? svgStyle.visitedLinkFillPaintColor() : svgStyle.visitedLinkStrokePaintColor();
             if (visitedColor.isValid())
                 color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
         }
index 00bec87..38d0e95 100644 (file)
@@ -90,7 +90,7 @@ bool RenderSVGResourceClipper::applyResource(RenderElement& renderer, const Rend
 bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext* context, const AffineTransform& animatedLocalTransform, const FloatRect& objectBoundingBox)
 {
     // If the current clip-path gets clipped itself, we have to fallback to masking.
-    if (!style().svgStyle()->clipperResource().isEmpty())
+    if (!style().svgStyle().clipperResource().isEmpty())
         return false;
     WindRule clipRule = RULE_NONZERO;
     Path clipPath = Path();
@@ -113,14 +113,14 @@ bool RenderSVGResourceClipper::pathOnlyClipping(GraphicsContext* context, const
         const RenderStyle& style = renderer->style();
         if (style.display() == NONE || style.visibility() != VISIBLE)
              continue;
-        const SVGRenderStyle* svgStyle = style.svgStyle();
+        const SVGRenderStyle& svgStyle = style.svgStyle();
         // Current shape in clip-path gets clipped too. Fallback to masking.
-        if (!svgStyle->clipperResource().isEmpty())
+        if (!svgStyle.clipperResource().isEmpty())
             return false;
         // Fallback to masking, if there is more than one clipping path.
         if (clipPath.isEmpty()) {
             styled->toClipPath(clipPath);
-            clipRule = svgStyle->clipRule();
+            clipRule = svgStyle.clipRule();
         } else
             return false;
     }
@@ -234,7 +234,7 @@ bool RenderSVGResourceClipper::drawContentIntoMaskImage(ClipperData* clipperData
         if (style.display() == NONE || style.visibility() != VISIBLE)
             continue;
 
-        WindRule newClipRule = style.svgStyle()->clipRule();
+        WindRule newClipRule = style.svgStyle().clipRule();
         bool isUseElement = child.hasTagName(SVGNames::useTag);
         if (isUseElement) {
             SVGUseElement& useElement = toSVGUseElement(child);
@@ -242,7 +242,7 @@ bool RenderSVGResourceClipper::drawContentIntoMaskImage(ClipperData* clipperData
             if (!renderer)
                 continue;
             if (!useElement.hasAttribute(SVGNames::clip_ruleAttr))
-                newClipRule = renderer->style().svgStyle()->clipRule();
+                newClipRule = renderer->style().svgStyle().clipRule();
         }
 
         // Only shapes, paths and texts are allowed for clipping.
index b676cf2..d788c11 100644 (file)
@@ -105,7 +105,7 @@ std::unique_ptr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(SVGFi
         builder->appendEffectToEffectReferences(effect, element->renderer());
         element->setStandardAttributes(effect.get());
         effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&*element, filterElement().primitiveUnits(), targetBoundingBox));
-        effect->setOperatingColorSpace(element->renderer()->style().svgStyle()->colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB);
+        effect->setOperatingColorSpace(element->renderer()->style().svgStyle().colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB);
         builder->add(element->result(), effect.release());
     }
     return builder;
index 57090a4..62ac652 100644 (file)
@@ -60,14 +60,14 @@ void RenderSVGResourceFilterPrimitive::styleDidChange(StyleDifference diff, cons
     if (diff == StyleDifferenceEqual || !oldStyle)
         return;
 
-    const SVGRenderStyle* newStyle = style().svgStyle();
+    const SVGRenderStyle& newStyle = style().svgStyle();
     if (filterPrimitiveElement().hasTagName(SVGNames::feFloodTag)) {
-        if (newStyle->floodColor() != oldStyle->svgStyle()->floodColor())
+        if (newStyle.floodColor() != oldStyle->svgStyle().floodColor())
             toRenderSVGResourceFilter(filter)->primitiveAttributeChanged(this, SVGNames::flood_colorAttr);
-        if (newStyle->floodOpacity() != oldStyle->svgStyle()->floodOpacity())
+        if (newStyle.floodOpacity() != oldStyle->svgStyle().floodOpacity())
             toRenderSVGResourceFilter(filter)->primitiveAttributeChanged(this, SVGNames::flood_opacityAttr);
     } else if (filterPrimitiveElement().hasTagName(SVGNames::feDiffuseLightingTag) || filterPrimitiveElement().hasTagName(SVGNames::feSpecularLightingTag)) {
-        if (newStyle->lightingColor() != oldStyle->svgStyle()->lightingColor())
+        if (newStyle.lightingColor() != oldStyle->svgStyle().lightingColor())
             toRenderSVGResourceFilter(filter)->primitiveAttributeChanged(this, SVGNames::lighting_colorAttr);
     }
 }
index fef74e5..913ab35 100644 (file)
@@ -186,17 +186,16 @@ bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, const Ren
         context->setTextDrawingMode(resourceMode & ApplyToFillMode ? TextModeFill : TextModeStroke);
     }
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     if (resourceMode & ApplyToFillMode) {
-        context->setAlpha(svgStyle->fillOpacity());
+        context->setAlpha(svgStyle.fillOpacity());
         context->setFillGradient(gradientData->gradient);
-        context->setFillRule(svgStyle->fillRule());
+        context->setFillRule(svgStyle.fillRule());
     } else if (resourceMode & ApplyToStrokeMode) {
-        if (svgStyle->vectorEffect() == VE_NON_SCALING_STROKE)
+        if (svgStyle.vectorEffect() == VE_NON_SCALING_STROKE)
             gradientData->gradient->setGradientSpaceTransform(transformOnNonScalingStroke(&renderer, gradientData->userspaceTransform));
-        context->setAlpha(svgStyle->strokeOpacity());
+        context->setAlpha(svgStyle.strokeOpacity());
         context->setStrokeGradient(gradientData->gradient);
         SVGRenderSupport::applyStrokeStyleToContext(context, style, renderer);
     }
index a59a865..12b7ed0 100644 (file)
@@ -84,9 +84,8 @@ bool RenderSVGResourceMasker::applyResource(RenderElement& renderer, const Rende
     FloatRect repaintRect = renderer.repaintRectInLocalCoordinates();
 
     if (!maskerData->maskImage && !repaintRect.isEmpty()) {
-        const SVGRenderStyle* svgStyle = style().svgStyle();
-        ASSERT(svgStyle);
-        ColorSpace colorSpace = svgStyle->colorInterpolation() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB;
+        const SVGRenderStyle& svgStyle = style().svgStyle();
+        ColorSpace colorSpace = svgStyle.colorInterpolation() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB;
         if (!SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, maskerData->maskImage, colorSpace, Unaccelerated))
             return false;
 
@@ -137,9 +136,8 @@ bool RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, C
     UNUSED_PARAM(colorSpace);
 #endif
 
-    ASSERT(style().svgStyle());
     // Create the luminance mask.
-    if (style().svgStyle()->maskType() == MT_LUMINANCE)
+    if (style().svgStyle().maskType() == MT_LUMINANCE)
         maskerData->maskImage->convertToLuminanceMask();
 
     return true;
index 5fb046a..e0d4306 100644 (file)
@@ -155,17 +155,16 @@ bool RenderSVGResourcePattern::applyResource(RenderElement& renderer, const Rend
     // Draw pattern
     context->save();
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     if (resourceMode & ApplyToFillMode) {
-        context->setAlpha(svgStyle->fillOpacity());
+        context->setAlpha(svgStyle.fillOpacity());
         context->setFillPattern(patternData->pattern);
-        context->setFillRule(svgStyle->fillRule());
+        context->setFillRule(svgStyle.fillRule());
     } else if (resourceMode & ApplyToStrokeMode) {
-        if (svgStyle->vectorEffect() == VE_NON_SCALING_STROKE)
+        if (svgStyle.vectorEffect() == VE_NON_SCALING_STROKE)
             patternData->pattern->setPatternSpaceTransform(transformOnNonScalingStroke(&renderer, patternData->transform));
-        context->setAlpha(svgStyle->strokeOpacity());
+        context->setAlpha(svgStyle.strokeOpacity());
         context->setStrokePattern(patternData->pattern);
         SVGRenderSupport::applyStrokeStyleToContext(context, style, renderer);
     }
index f1d9deb..d7a7e79 100644 (file)
@@ -47,26 +47,26 @@ bool RenderSVGResourceSolidColor::applyResource(RenderElement& renderer, const R
     ASSERT(context);
     ASSERT(resourceMode != ApplyToDefaultMode);
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
+    const SVGRenderStyle& svgStyle = style.svgStyle();
     ColorSpace colorSpace = style.colorSpace();
 
     bool isRenderingMask = renderer.view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask;
 
     if (resourceMode & ApplyToFillMode) {
-        if (!isRenderingMask && svgStyle)
-            context->setAlpha(svgStyle->fillOpacity());
+        if (!isRenderingMask)
+            context->setAlpha(svgStyle.fillOpacity());
         else
             context->setAlpha(1);
         context->setFillColor(m_color, colorSpace);
         if (!isRenderingMask)
-            context->setFillRule(svgStyle ? svgStyle->fillRule() : RULE_NONZERO);
+            context->setFillRule(svgStyle.fillRule());
 
         if (resourceMode & ApplyToTextMode)
             context->setTextDrawingMode(TextModeFill);
     } else if (resourceMode & ApplyToStrokeMode) {
         // When rendering the mask for a RenderSVGResourceClipper, the stroke code path is never hit.
         ASSERT(!isRenderingMask);
-        context->setAlpha(svgStyle ? svgStyle->strokeOpacity() : 1);
+        context->setAlpha(svgStyle.strokeOpacity());
         context->setStrokeColor(m_color, colorSpace);
 
         SVGRenderSupport::applyStrokeStyleToContext(context, style, renderer);
index d347c85..42aeec9 100644 (file)
@@ -368,8 +368,8 @@ void RenderSVGRoot::computeFloatRectForRepaint(const RenderLayerModelObject* rep
     // and then call RenderBox's method to handle all the normal CSS Box model bits
     repaintRect = m_localToBorderBoxTransform.mapRect(repaintRect);
 
-    const SVGRenderStyle* svgStyle = style().svgStyle();
-    if (const ShadowData* shadow = svgStyle->shadow())
+    const SVGRenderStyle& svgStyle = style().svgStyle();
+    if (const ShadowData* shadow = svgStyle.shadow())
         shadow->adjustRectForShadow(repaintRect);
 
     // Apply initial viewport clip - not affected by overflow settings
index d46e0af..105081a 100644 (file)
@@ -218,7 +218,7 @@ AffineTransform RenderSVGShape::nonScalingStrokeTransform() const
 
 bool RenderSVGShape::shouldGenerateMarkerPositions() const
 {
-    if (!style().svgStyle()->hasMarkers())
+    if (!style().svgStyle().hasMarkers())
         return false;
 
     if (!graphicsElement().supportsMarkers())
@@ -267,7 +267,7 @@ void RenderSVGShape::fillAndStrokeShape(GraphicsContext* context)
 
     fillShape(&style, context);
 
-    if (!style.svgStyle()->hasVisibleStroke())
+    if (!style.svgStyle().hasVisibleStroke())
         return;
 
     GraphicsContextStateSaver stateSaver(*context, false);
@@ -299,8 +299,8 @@ void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
             SVGRenderingContext renderingContext(*this, childPaintInfo);
 
             if (renderingContext.isRenderingPrepared()) {
-                const SVGRenderStyle* svgStyle = style().svgStyle();
-                if (svgStyle->shapeRendering() == SR_CRISPEDGES)
+                const SVGRenderStyle& svgStyle = style().svgStyle();
+                if (svgStyle.shapeRendering() == SR_CRISPEDGES)
                     childPaintInfo.context->setShouldAntialias(false);
 
                 fillAndStrokeShape(childPaintInfo.context);
@@ -337,12 +337,12 @@ bool RenderSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, request, style().pointerEvents());
     bool isVisible = (style().visibility() == VISIBLE);
     if (isVisible || !hitRules.requireVisible) {
-        const SVGRenderStyle* svgStyle = style().svgStyle();
-        WindRule fillRule = svgStyle->fillRule();
+        const SVGRenderStyle& svgStyle = style().svgStyle();
+        WindRule fillRule = svgStyle.fillRule();
         if (request.svgClipContent())
-            fillRule = svgStyle->clipRule();
-        if ((hitRules.canHitStroke && (svgStyle->hasStroke() || !hitRules.requireStroke) && strokeContains(localPoint, hitRules.requireStroke))
-            || (hitRules.canHitFill && (svgStyle->hasFill() || !hitRules.requireFill) && fillContains(localPoint, hitRules.requireFill, fillRule))) {
+            fillRule = svgStyle.clipRule();
+        if ((hitRules.canHitStroke && (svgStyle.hasStroke() || !hitRules.requireStroke) && strokeContains(localPoint, hitRules.requireStroke))
+            || (hitRules.canHitFill && (svgStyle.hasFill() || !hitRules.requireFill) && fillContains(localPoint, hitRules.requireFill, fillRule))) {
             updateHitTestResult(result, roundedLayoutPoint(localPoint));
             return true;
         }
@@ -396,8 +396,8 @@ FloatRect RenderSVGShape::calculateStrokeBoundingBox() const
     ASSERT(m_path);
     FloatRect strokeBoundingBox = m_fillBoundingBox;
 
-    const SVGRenderStyle* svgStyle = style().svgStyle();
-    if (svgStyle->hasStroke()) {
+    const SVGRenderStyle& svgStyle = style().svgStyle();
+    if (svgStyle.hasStroke()) {
         BoundingRectStrokeStyleApplier strokeStyle(*this);
         if (hasNonScalingStroke()) {
             AffineTransform nonScalingTransform = nonScalingStrokeTransform();
@@ -429,16 +429,16 @@ void RenderSVGShape::updateRepaintBoundingBox()
 float RenderSVGShape::strokeWidth() const
 {
     SVGLengthContext lengthContext(&graphicsElement());
-    return style().svgStyle()->strokeWidth().value(lengthContext);
+    return style().svgStyle().strokeWidth().value(lengthContext);
 }
 
 bool RenderSVGShape::hasSmoothStroke() const
 {
-    const SVGRenderStyle* svgStyle = style().svgStyle();
-    return svgStyle->strokeDashArray().isEmpty()
-        && svgStyle->strokeMiterLimit() == svgStyle->initialStrokeMiterLimit()
-        && svgStyle->joinStyle() == svgStyle->initialJoinStyle()
-        && svgStyle->capStyle() == svgStyle->initialCapStyle();
+    const SVGRenderStyle& svgStyle = style().svgStyle();
+    return svgStyle.strokeDashArray().isEmpty()
+        && svgStyle.strokeMiterLimit() == svgStyle.initialStrokeMiterLimit()
+        && svgStyle.joinStyle() == svgStyle.initialJoinStyle()
+        && svgStyle.capStyle() == svgStyle.initialCapStyle();
 }
 
 void RenderSVGShape::drawMarkers(PaintInfo& paintInfo)
index e77c2e5..04f7d85 100644 (file)
@@ -76,7 +76,7 @@ protected:
     float strokeWidth() const;
     bool hasSmoothStroke() const;
 
-    bool hasNonScalingStroke() const { return style().svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE; }
+    bool hasNonScalingStroke() const { return style().svgStyle().vectorEffect() == VE_NON_SCALING_STROKE; }
     AffineTransform nonScalingStrokeTransform() const;
     Path* nonScalingStrokePath(const Path*, const AffineTransform&) const;
 
index 9b6a88f..36de50a 100644 (file)
@@ -453,8 +453,8 @@ bool RenderSVGText::nodeAtFloatPoint(const HitTestRequest& request, HitTestResul
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, style().pointerEvents());
     bool isVisible = (style().visibility() == VISIBLE);
     if (isVisible || !hitRules.requireVisible) {
-        if ((hitRules.canHitStroke && (style().svgStyle()->hasStroke() || !hitRules.requireStroke))
-            || (hitRules.canHitFill && (style().svgStyle()->hasFill() || !hitRules.requireFill))) {
+        if ((hitRules.canHitStroke && (style().svgStyle().hasStroke() || !hitRules.requireStroke))
+            || (hitRules.canHitFill && (style().svgStyle().hasFill() || !hitRules.requireFill))) {
             FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
 
             if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
@@ -515,12 +515,12 @@ void RenderSVGText::paint(PaintInfo& paintInfo, const LayoutPoint&)
 FloatRect RenderSVGText::strokeBoundingBox() const
 {
     FloatRect strokeBoundaries = objectBoundingBox();
-    const SVGRenderStyle* svgStyle = style().svgStyle();
-    if (!svgStyle->hasStroke())
+    const SVGRenderStyle& svgStyle = style().svgStyle();
+    if (!svgStyle.hasStroke())
         return strokeBoundaries;
 
     SVGLengthContext lengthContext(&textElement());
-    strokeBoundaries.inflate(svgStyle->strokeWidth().value(lengthContext));
+    strokeBoundaries.inflate(svgStyle.strokeWidth().value(lengthContext));
     return strokeBoundaries;
 }
 
index ed7fef0..b89568e 100644 (file)
@@ -259,23 +259,21 @@ void SVGInlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint&, LayoutUni
 
     RenderStyle& style = parentRenderer.style();
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
-    bool hasFill = svgStyle->hasFill();
-    bool hasVisibleStroke = svgStyle->hasVisibleStroke();
+    bool hasFill = svgStyle.hasFill();
+    bool hasVisibleStroke = svgStyle.hasVisibleStroke();
 
     RenderStyle* selectionStyle = &style;
     if (hasSelection) {
         selectionStyle = parentRenderer.getCachedPseudoStyle(SELECTION);
         if (selectionStyle) {
-            const SVGRenderStyle* svgSelectionStyle = selectionStyle->svgStyle();
-            ASSERT(svgSelectionStyle);
+            const SVGRenderStyle& svgSelectionStyle = selectionStyle->svgStyle();
 
             if (!hasFill)
-                hasFill = svgSelectionStyle->hasFill();
+                hasFill = svgSelectionStyle.hasFill();
             if (!hasVisibleStroke)
-                hasVisibleStroke = svgSelectionStyle->hasVisibleStroke();
+                hasVisibleStroke = svgSelectionStyle.hasVisibleStroke();
         } else
             selectionStyle = &style;
     }
@@ -501,11 +499,10 @@ void SVGInlineTextBox::paintDecoration(GraphicsContext* context, TextDecoration
     if (decorationStyle.visibility() == HIDDEN)
         return;
 
-    const SVGRenderStyle* svgDecorationStyle = decorationStyle.svgStyle();
-    ASSERT(svgDecorationStyle);
+    const SVGRenderStyle& svgDecorationStyle = decorationStyle.svgStyle();
 
-    bool hasDecorationFill = svgDecorationStyle->hasFill();
-    bool hasVisibleDecorationStroke = svgDecorationStyle->hasVisibleStroke();
+    bool hasDecorationFill = svgDecorationStyle.hasFill();
+    bool hasVisibleDecorationStroke = svgDecorationStyle.hasVisibleStroke();
 
     if (hasDecorationFill) {
         m_paintingResourceMode = ApplyToFillMode;
@@ -673,8 +670,8 @@ bool SVGInlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult&
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, renderer().style().pointerEvents());
     bool isVisible = renderer().style().visibility() == VISIBLE;
     if (isVisible || !hitRules.requireVisible) {
-        if ((hitRules.canHitStroke && (renderer().style().svgStyle()->hasStroke() || !hitRules.requireStroke))
-            || (hitRules.canHitFill && (renderer().style().svgStyle()->hasFill() || !hitRules.requireFill))) {
+        if ((hitRules.canHitStroke && (renderer().style().svgStyle().hasStroke() || !hitRules.requireStroke))
+            || (hitRules.canHitFill && (renderer().style().svgStyle().hasFill() || !hitRules.requireFill))) {
             FloatPoint boxOrigin(x(), y());
             boxOrigin.moveBy(accumulatedOffset);
             FloatRect rect(boxOrigin, size());
index 0b2120e..b77b399 100644 (file)
@@ -65,8 +65,8 @@ LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o
     // Pass our local paint rect to computeRectForRepaint() which will
     // map to parent coords and recurse up the parent chain.
     FloatRect repaintRect = repaintRectForRendererInLocalCoordinatesExcludingSVGShadow(object);
-    const SVGRenderStyle* svgStyle = object->style().svgStyle();
-    if (const ShadowData* shadow = svgStyle->shadow())
+    const SVGRenderStyle& svgStyle = object->style().svgStyle();
+    if (const ShadowData* shadow = svgStyle.shadow())
         shadow->adjustRectForShadow(repaintRect);
     object->computeFloatRectForRepaint(repaintContainer, repaintRect);
     return enclosingLayoutRect(repaintRect);
@@ -74,8 +74,8 @@ LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o
 
 void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, const RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed)
 {
-    const SVGRenderStyle* svgStyle = object->style().svgStyle();
-    if (const ShadowData* shadow = svgStyle->shadow())
+    const SVGRenderStyle& svgStyle = object->style().svgStyle();
+    if (const ShadowData* shadow = svgStyle.shadow())
         shadow->adjustRectForShadow(repaintRect);
     repaintRect.inflate(object->style().outlineWidth());
 
@@ -350,11 +350,9 @@ void SVGRenderSupport::intersectRepaintRectWithShadows(const RenderObject* objec
 
     while (currentObject && rendererHasSVGShadow(currentObject)) {
         const RenderStyle& style = currentObject->style();
-        const SVGRenderStyle* svgStyle = style.svgStyle();
-        if (svgStyle) {
-            if (const ShadowData* shadow = svgStyle->shadow())
-                shadow->adjustRectForShadow(repaintRect);
-        }
+        const SVGRenderStyle& svgStyle = style.svgStyle();
+        if (const ShadowData* shadow = svgStyle.shadow())
+            shadow->adjustRectForShadow(repaintRect);
 
         repaintRect = currentObject->localToParentTransform().mapRect(repaintRect);
         localToRootTransform *= currentObject->localToParentTransform();
@@ -423,17 +421,16 @@ void SVGRenderSupport::applyStrokeStyleToContext(GraphicsContext* context, const
     ASSERT(renderer.element());
     ASSERT(renderer.element()->isSVGElement());
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     SVGLengthContext lengthContext(toSVGElement(renderer.element()));
-    context->setStrokeThickness(svgStyle->strokeWidth().value(lengthContext));
-    context->setLineCap(svgStyle->capStyle());
-    context->setLineJoin(svgStyle->joinStyle());
-    if (svgStyle->joinStyle() == MiterJoin)
-        context->setMiterLimit(svgStyle->strokeMiterLimit());
+    context->setStrokeThickness(svgStyle.strokeWidth().value(lengthContext));
+    context->setLineCap(svgStyle.capStyle());
+    context->setLineJoin(svgStyle.joinStyle());
+    if (svgStyle.joinStyle() == MiterJoin)
+        context->setMiterLimit(svgStyle.strokeMiterLimit());
 
-    const Vector<SVGLength>& dashes = svgStyle->strokeDashArray();
+    const Vector<SVGLength>& dashes = svgStyle.strokeDashArray();
     if (dashes.isEmpty())
         context->setStrokeStyle(SolidStroke);
     else {
@@ -442,7 +439,7 @@ void SVGRenderSupport::applyStrokeStyleToContext(GraphicsContext* context, const
         for (unsigned i = 0, size = dashes.size(); i < size; ++i)
             dashArray.uncheckedAppend(dashes[i].value(lengthContext));
 
-        context->setLineDash(dashArray, svgStyle->strokeDashOffset().value(lengthContext));
+        context->setLineDash(dashArray, svgStyle.strokeDashOffset().value(lengthContext));
     }
 }
 
@@ -454,7 +451,7 @@ void SVGRenderSupport::childAdded(RenderObject* parent, RenderObject* child)
 void SVGRenderSupport::styleChanged(RenderObject* object)
 {
     RenderObject* parent = object->parent();
-    SVGRenderSupport::setRendererHasSVGShadow(object, (parent && SVGRenderSupport::rendererHasSVGShadow(parent)) || (object->style().svgStyle() && object->style().svgStyle()->shadow()));
+    SVGRenderSupport::setRendererHasSVGShadow(object, (parent && SVGRenderSupport::rendererHasSVGShadow(parent)) || object->style().svgStyle().shadow());
 }
 
 }
index 3f24ea8..5bdcf91 100644 (file)
@@ -266,7 +266,7 @@ static void writeSVGPaintingResource(TextStream& ts, RenderSVGResource* resource
 static void writeStyle(TextStream& ts, const RenderObject& object)
 {
     const RenderStyle& style = object.style();
-    const SVGRenderStyle* svgStyle = style.svgStyle();
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     if (!object.localTransform().isIdentity())
         writeNameValuePair(ts, "transform", object.localTransform());
@@ -282,20 +282,20 @@ static void writeStyle(TextStream& ts, const RenderObject& object)
             writeSVGPaintingResource(ts, strokePaintingResource);
 
             SVGLengthContext lengthContext(&shape.graphicsElement());
-            double dashOffset = svgStyle->strokeDashOffset().value(lengthContext);
-            double strokeWidth = svgStyle->strokeWidth().value(lengthContext);
-            const Vector<SVGLength>& dashes = svgStyle->strokeDashArray();
+            double dashOffset = svgStyle.strokeDashOffset().value(lengthContext);
+            double strokeWidth = svgStyle.strokeWidth().value(lengthContext);
+            const Vector<SVGLength>& dashes = svgStyle.strokeDashArray();
 
             DashArray dashArray;
             const Vector<SVGLength>::const_iterator end = dashes.end();
             for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it)
                 dashArray.append((*it).value(lengthContext));
 
-            writeIfNotDefault(ts, "opacity", svgStyle->strokeOpacity(), 1.0f);
+            writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f);
             writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0);
-            writeIfNotDefault(ts, "miter limit", svgStyle->strokeMiterLimit(), 4.0f);
-            writeIfNotDefault(ts, "line cap", svgStyle->capStyle(), ButtCap);
-            writeIfNotDefault(ts, "line join", svgStyle->joinStyle(), MiterJoin);
+            writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4.0f);
+            writeIfNotDefault(ts, "line cap", svgStyle.capStyle(), ButtCap);
+            writeIfNotDefault(ts, "line join", svgStyle.joinStyle(), MiterJoin);
             writeIfNotDefault(ts, "dash offset", dashOffset, 0.0);
             if (!dashArray.isEmpty())
                 writeNameValuePair(ts, "dash array", dashArray);
@@ -308,16 +308,16 @@ static void writeStyle(TextStream& ts, const RenderObject& object)
             ts << " [fill={" << s;
             writeSVGPaintingResource(ts, fillPaintingResource);
 
-            writeIfNotDefault(ts, "opacity", svgStyle->fillOpacity(), 1.0f);
-            writeIfNotDefault(ts, "fill rule", svgStyle->fillRule(), RULE_NONZERO);
+            writeIfNotDefault(ts, "opacity", svgStyle.fillOpacity(), 1.0f);
+            writeIfNotDefault(ts, "fill rule", svgStyle.fillRule(), RULE_NONZERO);
             ts << "}]";
         }
-        writeIfNotDefault(ts, "clip rule", svgStyle->clipRule(), RULE_NONZERO);
+        writeIfNotDefault(ts, "clip rule", svgStyle.clipRule(), RULE_NONZERO);
     }
 
-    writeIfNotEmpty(ts, "start marker", svgStyle->markerStartResource());
-    writeIfNotEmpty(ts, "middle marker", svgStyle->markerMidResource());
-    writeIfNotEmpty(ts, "end marker", svgStyle->markerEndResource());
+    writeIfNotEmpty(ts, "start marker", svgStyle.markerStartResource());
+    writeIfNotEmpty(ts, "middle marker", svgStyle.markerMidResource());
+    writeIfNotEmpty(ts, "end marker", svgStyle.markerEndResource());
 }
 
 static TextStream& writePositionAndStyle(TextStream& ts, const RenderObject& object)
@@ -397,7 +397,7 @@ static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textB
     if (fragments.isEmpty())
         return;
 
-    const SVGRenderStyle* svgStyle = textBox->renderer().style().svgStyle();
+    const SVGRenderStyle& svgStyle = textBox->renderer().style().svgStyle();
     String text = textBox->renderer().text();
 
     unsigned fragmentsSize = fragments.size();
@@ -410,8 +410,8 @@ static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textB
 
         // FIXME: Remove this hack, once the new text layout engine is completly landed. We want to preserve the old layout test results for now.
         ts << "chunk 1 ";
-        ETextAnchor anchor = svgStyle->textAnchor();
-        bool isVerticalText = svgStyle->isVerticalWritingMode();
+        ETextAnchor anchor = svgStyle.textAnchor();
+        bool isVerticalText = svgStyle.isVerticalWritingMode();
         if (anchor == TA_MIDDLE) {
             ts << "(middle anchor";
             if (isVerticalText)
@@ -633,37 +633,37 @@ void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int
 void writeResources(TextStream& ts, const RenderObject& object, int indent)
 {
     const RenderStyle& style = object.style();
-    const SVGRenderStyle* svgStyle = style.svgStyle();
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     // FIXME: We want to use SVGResourcesCache to determine which resources are present, instead of quering the resource <-> id cache.
     // For now leave the DRT output as is, but later on we should change this so cycles are properly ignored in the DRT output.
     RenderObject& renderer = const_cast<RenderObject&>(object);
-    if (!svgStyle->maskerResource().isEmpty()) {
-        if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object.document(), svgStyle->maskerResource())) {
+    if (!svgStyle.maskerResource().isEmpty()) {
+        if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object.document(), svgStyle.maskerResource())) {
             writeIndent(ts, indent);
             ts << " ";
-            writeNameAndQuotedValue(ts, "masker", svgStyle->maskerResource());
+            writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource());
             ts << " ";
             writeStandardPrefix(ts, *masker, 0);
             ts << " " << masker->resourceBoundingBox(renderer) << "\n";
         }
     }
-    if (!svgStyle->clipperResource().isEmpty()) {
-        if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(object.document(), svgStyle->clipperResource())) {
+    if (!svgStyle.clipperResource().isEmpty()) {
+        if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(object.document(), svgStyle.clipperResource())) {
             writeIndent(ts, indent);
             ts << " ";
-            writeNameAndQuotedValue(ts, "clipPath", svgStyle->clipperResource());
+            writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource());
             ts << " ";
             writeStandardPrefix(ts, *clipper, 0);
             ts << " " << clipper->resourceBoundingBox(renderer) << "\n";
         }
     }
 #if ENABLE(FILTERS)
-    if (!svgStyle->filterResource().isEmpty()) {
-        if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object.document(), svgStyle->filterResource())) {
+    if (!svgStyle.filterResource().isEmpty()) {
+        if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object.document(), svgStyle.filterResource())) {
             writeIndent(ts, indent);
             ts << " ";
-            writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
+            writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource());
             ts << " ";
             writeStandardPrefix(ts, *filter, 0);
             ts << " " << filter->resourceBoundingBox(renderer) << "\n";
index 02e6460..e19d60f 100644 (file)
@@ -99,13 +99,12 @@ void SVGRenderingContext::prepareToRenderSVGContent(RenderElement& renderer, Pai
 
     RenderStyle& style = m_renderer->style();
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     // Setup transparency layers before setting up SVG resources!
     bool isRenderingMask = isRenderingMaskImage(*m_renderer);
     float opacity = isRenderingMask ? 1 : style.opacity();
-    const ShadowData* shadow = svgStyle->shadow();
+    const ShadowData* shadow = svgStyle.shadow();
     if (opacity < 1 || shadow) {
         FloatRect repaintRect = m_renderer->repaintRectInLocalCoordinates();
 
@@ -132,7 +131,7 @@ void SVGRenderingContext::prepareToRenderSVGContent(RenderElement& renderer, Pai
     SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(m_renderer);
     if (!resources) {
 #if ENABLE(FILTERS)
-        if (svgStyle->hasFilter())
+        if (svgStyle.hasFilter())
             return;
 #endif
         m_renderingFlags |= RenderingPrepared;
index 6289524..3628d2f 100644 (file)
@@ -42,12 +42,11 @@ void SVGResourcesCache::addResourcesFromRenderer(RenderElement& renderer, const
 {
     ASSERT(!m_cache.contains(&renderer));
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     // Build a list of all resources associated with the passed RenderObject
     OwnPtr<SVGResources> newResources = adoptPtr(new SVGResources);
-    if (!newResources->buildCachedResources(&renderer, svgStyle))
+    if (!newResources->buildCachedResources(&renderer, &svgStyle))
         return;
 
     // Put object in cache.
index d651b9f..f8f23ba 100644 (file)
@@ -95,8 +95,7 @@ void SVGTextChunkBuilder::addTextChunk(Vector<SVGInlineTextBox*>& lineLayoutBoxe
 
     const RenderStyle& style = textBox->renderer().style();
 
-    const SVGRenderStyle* svgStyle = style.svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style.svgStyle();
 
     // Build chunk style flags.
     unsigned chunkStyle = SVGTextChunk::DefaultStyle;
@@ -106,11 +105,11 @@ void SVGTextChunkBuilder::addTextChunk(Vector<SVGInlineTextBox*>& lineLayoutBoxe
         chunkStyle |= SVGTextChunk::RightToLeftText;
 
     // Handle 'writing-mode' property.
-    if (svgStyle->isVerticalWritingMode())
+    if (svgStyle.isVerticalWritingMode())
         chunkStyle |= SVGTextChunk::VerticalText;
 
     // Handle 'text-anchor' property.
-    switch (svgStyle->textAnchor()) {
+    switch (svgStyle.textAnchor()) {
     case TA_START:
         break;
     case TA_MIDDLE:
index 43976bc..ab6eff7 100644 (file)
@@ -243,7 +243,7 @@ void SVGTextLayoutEngine::layoutInlineTextBox(SVGInlineTextBox* textBox)
     const RenderStyle& style = text.style();
 
     textBox->clearTextFragments();
-    m_isVerticalText = style.svgStyle()->isVerticalWritingMode();
+    m_isVerticalText = style.svgStyle().isVerticalWritingMode();
     layoutTextOnLineOrPath(textBox, &text, &style);
 
     if (m_inPathLayout) {
@@ -431,8 +431,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, Rend
     RenderObject* textParent = text->parent();
     bool definesTextLength = textParent ? parentDefinesTextLength(textParent) : false;
 
-    const SVGRenderStyle* svgStyle = style->svgStyle();
-    ASSERT(svgStyle);
+    const SVGRenderStyle& svgStyle = style->svgStyle();
 
     m_visualMetricsListOffset = 0;
     m_visualCharacterOffset = 0;
@@ -450,7 +449,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, Rend
     bool applySpacingToNextCharacter = false;
 
     float lastAngle = 0;
-    float baselineShift = baselineLayout.calculateBaselineShift(svgStyle, lengthContext);
+    float baselineShift = baselineLayout.calculateBaselineShift(&svgStyle, lengthContext);
     baselineShift -= baselineLayout.calculateAlignmentBaselineShift(m_isVerticalText, text);
 
     // Main layout algorithm.
@@ -492,7 +491,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, Rend
 
         // Calculate glyph orientation angle.
         const UChar* currentCharacter = characters + m_visualCharacterOffset;
-        float orientationAngle = baselineLayout.calculateGlyphOrientationAngle(m_isVerticalText, svgStyle, *currentCharacter);
+        float orientationAngle = baselineLayout.calculateGlyphOrientationAngle(m_isVerticalText, &svgStyle, *currentCharacter);
 
         // Calculate glyph advance & x/y orientation shifts.
         float xOrientationShift = 0;
@@ -509,7 +508,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, Rend
         float kerning = spacingLayout.calculateSVGKerning(m_isVerticalText, visualMetrics.glyph());
 
         // Calculate CSS 'kerning', 'letter-spacing' and 'word-spacing' for next character, if needed.
-        float spacing = spacingLayout.calculateCSSKerningAndSpacing(svgStyle, lengthContext, currentCharacter);
+        float spacing = spacingLayout.calculateCSSKerningAndSpacing(&svgStyle, lengthContext, currentCharacter);
 
         float textPathOffset = 0;
         if (m_inPathLayout) {
index c9185d8..4284e35 100644 (file)
@@ -65,10 +65,9 @@ EAlignmentBaseline SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBasel
     ASSERT(textRenderer);
     ASSERT(textRenderer->parent());
 
-    const SVGRenderStyle* style = textRenderer->style().svgStyle();
-    ASSERT(style);
+    const SVGRenderStyle& svgStyle = textRenderer->style().svgStyle();
 
-    EDominantBaseline baseline = style->dominantBaseline();
+    EDominantBaseline baseline = svgStyle.dominantBaseline();
     if (baseline == DB_AUTO) {
         if (isVerticalText)
             baseline = DB_CENTRAL;
@@ -109,13 +108,12 @@ EAlignmentBaseline SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBasel
 float SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift(bool isVerticalText, const RenderObject* textRenderer) const
 {
     ASSERT(textRenderer);
-    ASSERT(textRenderer->style().svgStyle());
     ASSERT(textRenderer->parent());
 
     const RenderObject* textRendererParent = textRenderer->parent();
     ASSERT(textRendererParent);
 
-    EAlignmentBaseline baseline = textRenderer->style().svgStyle()->alignmentBaseline();
+    EAlignmentBaseline baseline = textRenderer->style().svgStyle().alignmentBaseline();
     if (baseline == AB_AUTO) {
         baseline = dominantBaselineToAlignmentBaseline(isVerticalText, textRendererParent);
         ASSERT(baseline != AB_AUTO);
index 88c55fe..bdc92bf 100644 (file)
@@ -116,9 +116,8 @@ bool SVGTextQuery::executeQuery(Data* queryData, ProcessTextFragmentCallback fra
     for (unsigned textBoxPosition = 0; textBoxPosition < textBoxCount; ++textBoxPosition) {
         queryData->textBox = m_textBoxes.at(textBoxPosition);
         queryData->textRenderer = &queryData->textBox->renderer();
-        ASSERT(queryData->textRenderer->style().svgStyle());
 
-        queryData->isVerticalText = queryData->textRenderer->style().svgStyle()->isVerticalWritingMode();
+        queryData->isVerticalText = queryData->textRenderer->style().svgStyle().isVerticalWritingMode();
         const Vector<SVGTextFragment>& fragments = queryData->textBox->textFragments();
     
         // Loop over all text fragments in this text box, firing a callback for each.
index 6248972..0c19740 100644 (file)
@@ -121,7 +121,7 @@ void SVGTextRunRenderingContext::drawSVGGlyphs(GraphicsContext* context, const S
 
     auto& elementRenderer = renderer().isRenderElement() ? toRenderElement(renderer()) : *renderer().parent();
     RenderStyle& style = elementRenderer.style();
-    bool isVerticalText = style.svgStyle()->isVerticalWritingMode();
+    bool isVerticalText = style.svgStyle().isVerticalWritingMode();
 
     float scale = scaleEmToUnits(fontData->platformData().size(), fontFaceElement->unitsPerEm());
     ASSERT(activePaintingResource);
index 7aa2e19..d8e2d16 100644 (file)
@@ -131,7 +131,7 @@ bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect,
     if (attrName == SVGNames::lighting_colorAttr) {
         RenderObject* renderer = this->renderer();
         ASSERT(renderer);
-        return diffuseLighting->setLightingColor(renderer->style().svgStyle()->lightingColor());
+        return diffuseLighting->setLightingColor(renderer->style().svgStyle().lightingColor());
     }
     if (attrName == SVGNames::surfaceScaleAttr)
         return diffuseLighting->setSurfaceScale(surfaceScale());
@@ -217,7 +217,7 @@ PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi
     if (!renderer)
         return 0;
     
-    Color color = renderer->style().svgStyle()->lightingColor();
+    Color color = renderer->style().svgStyle().lightingColor();
 
     RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(),
                                                                 kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
index f6af8ff..3da5c25 100644 (file)
@@ -158,10 +158,10 @@ PassRefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterB
     if (stdDeviationX() < 0 || stdDeviationY() < 0)
         return 0;
 
-    const SVGRenderStyle* svgStyle = renderer->style().svgStyle();
+    const SVGRenderStyle& svgStyle = renderer->style().svgStyle();
     
-    Color color = svgStyle->floodColor();
-    float opacity = svgStyle->floodOpacity();
+    Color color = svgStyle.floodColor();
+    float opacity = svgStyle.floodOpacity();
 
     FilterEffect* input1 = filterBuilder->getEffectById(in1());
     if (!input1)
index 6605292..22e216a 100644 (file)
@@ -50,9 +50,9 @@ bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const Qua
     FEFlood* flood = static_cast<FEFlood*>(effect);
 
     if (attrName == SVGNames::flood_colorAttr)
-        return flood->setFloodColor(style.svgStyle()->floodColor());
+        return flood->setFloodColor(style.svgStyle().floodColor());
     if (attrName == SVGNames::flood_opacityAttr)
-        return flood->setFloodOpacity(style.svgStyle()->floodOpacity());
+        return flood->setFloodOpacity(style.svgStyle().floodOpacity());
 
     ASSERT_NOT_REACHED();
     return false;
@@ -64,10 +64,10 @@ PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter* fil
     if (!renderer)
         return 0;
     
-    const SVGRenderStyle* svgStyle = renderer->style().svgStyle();
+    const SVGRenderStyle& svgStyle = renderer->style().svgStyle();
 
-    Color color = svgStyle->floodColor();
-    float opacity = svgStyle->floodOpacity();
+    Color color = svgStyle.floodColor();
+    float opacity = svgStyle.floodOpacity();
 
     return FEFlood::create(filter, color, opacity);
 }
index da1d1fa..7797471 100644 (file)
@@ -140,7 +140,7 @@ bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect
     if (attrName == SVGNames::lighting_colorAttr) {
         RenderObject* renderer = this->renderer();
         ASSERT(renderer);
-        return specularLighting->setLightingColor(renderer->style().svgStyle()->lightingColor());
+        return specularLighting->setLightingColor(renderer->style().svgStyle().lightingColor());
     }
     if (attrName == SVGNames::surfaceScaleAttr)
         return specularLighting->setSurfaceScale(surfaceScale());
@@ -228,7 +228,7 @@ PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f
     if (!renderer)
         return 0;
     
-    Color color = renderer->style().svgStyle()->lightingColor();
+    Color color = renderer->style().svgStyle().lightingColor();
 
     RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(),
                                           specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
index f8bf4dc..a786400 100644 (file)
@@ -169,7 +169,7 @@ bool SVGFontData::applySVGGlyphSelection(WidthIterator& iterator, GlyphData& gly
         RenderElement* parentRenderer = renderObject->isRenderElement() ? toRenderElement(renderObject) : renderObject->parent();
         ASSERT(parentRenderer);
 
-        isVerticalText = parentRenderer->style().svgStyle()->isVerticalWritingMode();
+        isVerticalText = parentRenderer->style().svgStyle().isVerticalWritingMode();
         if (Element* parentRendererElement = parentRenderer->element()) {
             language = parentRendererElement->getAttribute(XMLNames::langAttr);
 
index d7c946f..8e24425 100644 (file)
@@ -116,11 +116,11 @@ Color SVGStopElement::stopColorIncludingOpacity() const
     // FIXME: This check for null style exists to address Bug WK 90814, a rare crash condition in
     // which the renderer or style is null. This entire class is scheduled for removal (Bug WK 86941)
     // and we will tolerate this null check until then.
-    if (!style || !style->svgStyle())
+    if (!style)
         return Color(Color::transparent, true); // Transparent black.
 
-    const SVGRenderStyle* svgStyle = style->svgStyle();
-    return colorWithOverrideAlpha(svgStyle->stopColor().rgb(), svgStyle->stopOpacity());
+    const SVGRenderStyle& svgStyle = style->svgStyle();
+    return colorWithOverrideAlpha(svgStyle.stopColor().rgb(), svgStyle.stopOpacity());
 }
 
 }