Bug 807213 - Stop creating nsSVGMarkerProperty objects for non-nsSVGPathGeometryFrame frames. r=roc, a=lsblakk.
authorJonathan Watt <jwatt@jwatt.org>
Wed, 31 Oct 2012 18:34:10 +0000
changeset 113824 062ae9c63641bd5882a62c66904a2b84337c2409
parent 113823 267a86de82dff19e071e6288c180a52fab7aa766
child 113825 39150ccd48c1aa99442fabe91a39edbb6b7655b4
push id2523
push userjwatt@jwatt.org
push dateWed, 31 Oct 2012 18:34:53 +0000
treeherdermozilla-aurora@062ae9c63641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs807213
milestone18.0a2
Bug 807213 - Stop creating nsSVGMarkerProperty objects for non-nsSVGPathGeometryFrame frames. r=roc, a=lsblakk.
layout/svg/nsSVGEffects.cpp
--- a/layout/svg/nsSVGEffects.cpp
+++ b/layout/svg/nsSVGEffects.cpp
@@ -6,16 +6,17 @@
 // Main header first:
 #include "nsSVGEffects.h"
 
 // Keep others in (case-insensitive) order:
 #include "nsCSSFrameConstructor.h"
 #include "nsISupportsImpl.h"
 #include "nsSVGClipPathFrame.h"
 #include "nsSVGPaintServerFrame.h"
+#include "nsSVGPathGeometryElement.h"
 #include "nsSVGFilterFrame.h"
 #include "nsSVGMaskFrame.h"
 #include "nsSVGTextPathFrame.h"
 #include "nsIReflowCallback.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
@@ -381,16 +382,19 @@ 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 &&
+                    static_cast<nsSVGPathGeometryElement*>(aFrame->GetContent())->IsMarkable(),
+                    "Bad frame");
   return static_cast<nsSVGMarkerProperty*>(
           GetEffectProperty(aURI, aFrame, aProp, CreateMarkerProperty));
 }
 
 nsSVGTextPathProperty *
 nsSVGEffects::GetTextPathProperty(nsIURI *aURI, nsIFrame *aFrame,
                                   const FramePropertyDescriptor *aProp)
 {
@@ -522,17 +526,18 @@ 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 &&
+      static_cast<nsSVGPathGeometryElement*>(aFrame->GetContent())->IsMarkable()) {
     // 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);