Bug 807213 - Stop creating nsSVGMarkerProperty objects for non-nsSVGPathGeometryFrame frames. r=roc.
authorJonathan Watt <jwatt@jwatt.org>
Wed, 31 Oct 2012 04:11:00 +0000
changeset 112001 734c42e768134f752d7af18fe05b1ce333e90c98
parent 112000 d3f1545072f3867d58dff0130a751354c2ae2305
child 112002 10eca8d80a847aa1999c952ee521e7017445ea3c
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersroc
bugs807213
milestone19.0a1
Bug 807213 - Stop creating nsSVGMarkerProperty objects for non-nsSVGPathGeometryFrame frames. r=roc.
layout/svg/nsSVGEffects.cpp
--- a/layout/svg/nsSVGEffects.cpp
+++ b/layout/svg/nsSVGEffects.cpp
@@ -381,16 +381,18 @@ GetEffectProperty(nsIURI *aURI, nsIFrame
   props.Set(aProperty, static_cast<nsISupports*>(prop));
   return prop;
 }
 
 nsSVGMarkerProperty *
 nsSVGEffects::GetMarkerProperty(nsIURI *aURI, nsIFrame *aFrame,
                                 const FramePropertyDescriptor *aProp)
 {
+  NS_ABORT_IF_FALSE(aFrame->GetType() == nsGkAtoms::svgPathGeometryFrame,
+                    "Bad frame");
   return static_cast<nsSVGMarkerProperty*>(
           GetEffectProperty(aURI, aFrame, aProp, CreateMarkerProperty));
 }
 
 nsSVGTextPathProperty *
 nsSVGEffects::GetTextPathProperty(nsIURI *aURI, nsIFrame *aFrame,
                                   const FramePropertyDescriptor *aProp)
 {
@@ -522,17 +524,17 @@ nsSVGEffects::UpdateEffects(nsIFrame *aF
   props.Delete(StrokeProperty());
   props.Delete(BackgroundImageProperty());
 
   // Ensure that the filter is repainted correctly
   // We can't do that in DoUpdate as the referenced frame may not be valid
   GetEffectProperty(aFrame->GetStyleSVGReset()->mFilter,
                     aFrame, FilterProperty(), CreateFilterProperty);
 
-  if (aFrame->IsFrameOfType(nsIFrame::eSVG)) {
+  if (aFrame->GetType() == nsGkAtoms::svgPathGeometryFrame) {
     // Set marker properties here to avoid reference loops
     const nsStyleSVG *style = aFrame->GetStyleSVG();
     GetEffectProperty(style->mMarkerStart, aFrame, MarkerBeginProperty(),
                       CreateMarkerProperty);
     GetEffectProperty(style->mMarkerMid, aFrame, MarkerMiddleProperty(),
                       CreateMarkerProperty);
     GetEffectProperty(style->mMarkerEnd, aFrame, MarkerEndProperty(),
                       CreateMarkerProperty);