Bug 775304 - Don't visit the descendant frames for the nsChangeHint_UpdateEffects hint. r=roc, r=dbaron.
authorJonathan Watt <jwatt@jwatt.org>
Thu, 19 Jul 2012 15:44:04 -0400
changeset 99831 0a00993c6ebe12a8e7771636d9c6eb04a695ed64
parent 99830 e1b7eef10f3ef344488f91d5bf950ecf30714d64
child 99832 afd9e75374e866ff698d4d4e49a4d28c59e3d551
push id934
push userrcampbell@mozilla.com
push dateFri, 20 Jul 2012 14:05:35 +0000
treeherderfx-team@6d4904694feb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, dbaron
bugs775304
milestone17.0a1
Bug 775304 - Don't visit the descendant frames for the nsChangeHint_UpdateEffects hint. r=roc, r=dbaron.
layout/base/nsChangeHint.h
layout/style/nsStyleStruct.h
layout/svg/base/src/nsSVGEffects.cpp
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -107,16 +107,17 @@ enum nsChangeHint {
    * is being processed.  This optimization does not apply in some of the
    * cases where applying a hint to an element does not necessarily result
    * in the same hint being handled on the descendants.
    *
    * If you're adding such a hint, you should add your hint to this list.
    */
   nsChangeHint_NonInherited_Hints =
     nsChangeHint_UpdateTransformLayer |
+    nsChangeHint_UpdateEffects |
     nsChangeHint_UpdateOpacityLayer |
     nsChangeHint_UpdateOverflow |
     nsChangeHint_ChildrenOnlyTransform |
     nsChangeHint_RecomputePosition
 };
 
 // Redefine these operators to return nothing. This will catch any use
 // of these operators on hints. We should not be using these operators
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -311,17 +311,17 @@ struct nsStyleBackground {
     return aContext->AllocateFromShell(sz);
   }
   void Destroy(nsPresContext* aContext);
 
   nsChangeHint CalcDifference(const nsStyleBackground& aOther) const;
 #ifdef DEBUG
   static nsChangeHint MaxDifference();
 #endif
-  static bool ForceCompare() { return false; }
+  static bool ForceCompare() { return true; }
 
   struct Position;
   friend struct Position;
   struct Position {
     typedef nsStyleCoord::Calc PositionCoord;
     PositionCoord mXPosition, mYPosition;
 
     // Initialize nothing
@@ -2153,17 +2153,17 @@ struct nsStyleSVG {
     this->~nsStyleSVG();
     aContext->FreeToShell(sizeof(nsStyleSVG), this);
   }
 
   nsChangeHint CalcDifference(const nsStyleSVG& aOther) const;
 #ifdef DEBUG
   static nsChangeHint MaxDifference();
 #endif
-  static bool ForceCompare() { return false; }
+  static bool ForceCompare() { return true; }
 
   nsStyleSVGPaint  mFill;             // [inherited]
   nsStyleSVGPaint  mStroke;           // [inherited]
   nsCOMPtr<nsIURI> mMarkerEnd;        // [inherited]
   nsCOMPtr<nsIURI> mMarkerMid;        // [inherited]
   nsCOMPtr<nsIURI> mMarkerStart;      // [inherited]
   nsStyleCoord    *mStrokeDasharray;  // [inherited] coord, percent, factor
 
@@ -2199,17 +2199,17 @@ struct nsStyleSVGReset {
     this->~nsStyleSVGReset();
     aContext->FreeToShell(sizeof(nsStyleSVGReset), this);
   }
 
   nsChangeHint CalcDifference(const nsStyleSVGReset& aOther) const;
 #ifdef DEBUG
   static nsChangeHint MaxDifference();
 #endif
-  static bool ForceCompare() { return false; }
+  static bool ForceCompare() { return true; }
 
   nsCOMPtr<nsIURI> mClipPath;         // [reset]
   nsCOMPtr<nsIURI> mFilter;           // [reset]
   nsCOMPtr<nsIURI> mMask;             // [reset]
   nscolor          mStopColor;        // [reset]
   nscolor          mFloodColor;       // [reset]
   nscolor          mLightingColor;    // [reset]
 
--- a/layout/svg/base/src/nsSVGEffects.cpp
+++ b/layout/svg/base/src/nsSVGEffects.cpp
@@ -468,24 +468,16 @@ nsSVGEffects::UpdateEffects(nsIFrame *aF
     const nsStyleSVG *style = aFrame->GetStyleSVG();
     GetEffectProperty(style->mMarkerStart, aFrame, MarkerBeginProperty(),
                       CreateMarkerProperty);
     GetEffectProperty(style->mMarkerMid, aFrame, MarkerMiddleProperty(),
                       CreateMarkerProperty);
     GetEffectProperty(style->mMarkerEnd, aFrame, MarkerEndProperty(),
                       CreateMarkerProperty);
   }
-
-  nsIFrame *kid = aFrame->GetFirstPrincipalChild();
-  while (kid) {
-    if (kid->GetContent()->IsElement()) {
-      UpdateEffects(kid);
-    }
-    kid = kid->GetNextSibling();
-  }
 }
 
 nsSVGFilterProperty *
 nsSVGEffects::GetFilterProperty(nsIFrame *aFrame)
 {
   NS_ASSERTION(!aFrame->GetPrevContinuation(), "aFrame should be first continuation");
 
   if (!aFrame->GetStyleSVGReset()->mFilter)