Bug 1340257 - Part 2. Revert the change in bug 842114. draft
authorcku <cku@mozilla.com>
Wed, 22 Feb 2017 16:27:40 +0800
changeset 487856 04d81cbf657b0dd831f319c5f42469445d3326cf
parent 487855 10041e8a32abeb67c65232bb13c87f2279e41724
child 546586 dcd617b8c1006f75a49a829c4b546f3c73feb7cb
push id46369
push userbmo:cku@mozilla.com
push dateWed, 22 Feb 2017 08:45:35 +0000
bugs1340257, 842114
milestone54.0a1
Bug 1340257 - Part 2. Revert the change in bug 842114. MozReview-Commit-ID: Kqyt4AHwpJL
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -50,42 +50,39 @@ public:
    * If the pre-effects visual overflow rect of the frame being examined
    * happens to be known, it can be passed in as aCurrentFrame and its
    * pre-effects visual overflow rect can be passed in as
    * aCurrentFrameOverflowArea. This is just an optimization to save a
    * frame property lookup - these arguments are optional.
    */
   PreEffectsVisualOverflowCollector(nsIFrame* aFirstContinuation,
                                     nsIFrame* aCurrentFrame,
-                                    const nsRect& aCurrentFrameOverflowArea,
-                                    bool aCheckPreEffectsBBoxPropCache)
+                                    const nsRect& aCurrentFrameOverflowArea)
     : mFirstContinuation(aFirstContinuation)
     , mCurrentFrame(aCurrentFrame)
     , mCurrentFrameOverflowArea(aCurrentFrameOverflowArea)
-    , mCheckPreEffectsBBoxPropCache(aCheckPreEffectsBBoxPropCache)
   {
     NS_ASSERTION(!mFirstContinuation->GetPrevContinuation(),
                  "We want the first continuation here");
   }
 
   virtual void AddBox(nsIFrame* aFrame) override {
     nsRect overflow = (aFrame == mCurrentFrame)
       ? mCurrentFrameOverflowArea
-      : GetPreEffectsVisualOverflowRect(aFrame, mCheckPreEffectsBBoxPropCache);
+      : GetPreEffectsVisualOverflowRect(aFrame);
     mResult.UnionRect(mResult, overflow + aFrame->GetOffsetTo(mFirstContinuation));
   }
 
   nsRect GetResult() const {
     return mResult;
   }
 
 private:
 
-  static nsRect GetPreEffectsVisualOverflowRect(nsIFrame* aFrame,
-                                                bool aCheckPropCache) {
+  static nsRect GetPreEffectsVisualOverflowRect(nsIFrame* aFrame) {
     nsRect* r = aFrame->Properties().Get(nsIFrame::PreEffectsBBoxProperty());
     if (r) {
       return *r;
     }
 
 #ifdef DEBUG
     // Having PreTransformOverflowAreasProperty cached means
     // GetVisualOverflowRect() will return post-effect rect, which is not what
@@ -102,36 +99,33 @@ private:
 #endif
     return aFrame->GetVisualOverflowRect();
   }
 
   nsIFrame*     mFirstContinuation;
   nsIFrame*     mCurrentFrame;
   const nsRect& mCurrentFrameOverflowArea;
   nsRect        mResult;
-  bool          mCheckPreEffectsBBoxPropCache;
 };
 
 /**
  * Gets the union of the pre-effects visual overflow rects of all of a frame's
  * continuations, in "user space".
  */
 static nsRect
 GetPreEffectsVisualOverflowUnion(nsIFrame* aFirstContinuation,
                                  nsIFrame* aCurrentFrame,
                                  const nsRect& aCurrentFramePreEffectsOverflow,
-                                 const nsPoint& aFirstContinuationToUserSpace,
-                                 bool aCheckPreEffectsBBoxPropCache)
+                                 const nsPoint& aFirstContinuationToUserSpace)
 {
   NS_ASSERTION(!aFirstContinuation->GetPrevContinuation(),
                "Need first continuation here");
   PreEffectsVisualOverflowCollector collector(aFirstContinuation,
                                               aCurrentFrame,
-                                              aCurrentFramePreEffectsOverflow,
-                                              aCheckPreEffectsBBoxPropCache);
+                                              aCurrentFramePreEffectsOverflow);
   // Compute union of all overflow areas relative to aFirstContinuation:
   nsLayoutUtils::GetAllInFlowBoxes(aFirstContinuation, &collector);
   // Return the result in user space:
   return collector.GetResult() + aFirstContinuationToUserSpace;
 }
 
 
 bool
@@ -199,18 +193,17 @@ gfxRect
 nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame(nsIFrame* aNonSVGFrame)
 {
   NS_ASSERTION(!aNonSVGFrame->IsFrameOfType(nsIFrame::eSVG),
                "SVG frames should not get here");
   nsIFrame* firstFrame =
     nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
   // 'r' is in "user space":
   nsRect r = GetPreEffectsVisualOverflowUnion(firstFrame, nullptr, nsRect(),
-                                              GetOffsetToBoundingBox(firstFrame),
-                                              true);
+                                              GetOffsetToBoundingBox(firstFrame));
   return nsLayoutUtils::RectToGfxRect(r,
            aNonSVGFrame->PresContext()->AppUnitsPerCSSPixel());
 }
 
 // XXX Since we're called during reflow, this method is broken for frames with
 // continuations. When we're called for a frame with continuations, we're
 // called for each continuation in turn as it's reflowed. However, it isn't
 // until the last continuation is reflowed that this method's
@@ -262,21 +255,17 @@ nsRect
   nsPoint firstFrameToBoundingBox = GetOffsetToBoundingBox(firstFrame);
   // overrideBBox is in "user space", in _CSS_ pixels:
   // XXX Why are we rounding out to pixel boundaries? We don't do that in
   // GetSVGBBoxForNonSVGFrame, and it doesn't appear to be necessary.
   gfxRect overrideBBox =
     nsLayoutUtils::RectToGfxRect(
       GetPreEffectsVisualOverflowUnion(firstFrame, aFrame,
                                        aPreEffectsOverflowRect,
-                                       firstFrameToBoundingBox,
-                                       false /* See the beginning of the
-                                                comment above this function to
-                                                know why we skip this
-                                                checking. */),
+                                       firstFrameToBoundingBox),
       aFrame->PresContext()->AppUnitsPerCSSPixel());
   overrideBBox.RoundOut();
 
   nsRect overflowRect =
     nsFilterInstance::GetPostFilterBounds(firstFrame, &overrideBBox);
 
   // Return overflowRect relative to aFrame, rather than "user space":
   return overflowRect - (aFrame->GetOffsetTo(firstFrame) + firstFrameToBoundingBox);