Bug 774095 - Make sure that we call nsSVGEffects::UpdateEffects() on frames that are added after the first reflow. r=dholbert.
authorJonathan Watt <jwatt@jwatt.org>
Sun, 15 Jul 2012 20:42:50 -0400
changeset 99402 2cdd7ca5a5883d23c1227b6cea7fef7dc3f5c783
parent 99401 b2a1fa5d8c3683f76b07bc1461143e205af731a6
child 99403 e72e124b791aabcf9944ed1a8a5f72c08fa504dc
push id23128
push useremorley@mozilla.com
push dateMon, 16 Jul 2012 14:01:04 +0000
treeherdermozilla-central@00405b1daf05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs774095
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 774095 - Make sure that we call nsSVGEffects::UpdateEffects() on frames that are added after the first reflow. r=dholbert.
layout/svg/base/src/nsSVGContainerFrame.cpp
--- a/layout/svg/base/src/nsSVGContainerFrame.cpp
+++ b/layout/svg/base/src/nsSVGContainerFrame.cpp
@@ -114,22 +114,27 @@ nsSVGDisplayContainerFrame::InsertFrames
         (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN |
          NS_STATE_SVG_NONDISPLAY_CHILD))) {
     for (nsIFrame* kid = firstNewFrame; kid != firstOldFrame;
          kid = kid->GetNextSibling()) {
       nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
       if (SVGFrame) {
         NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
                           "Check for this explicitly in the |if|, then");
+        bool isFirstReflow = (kid->GetStateBits() & NS_FRAME_FIRST_REFLOW);
         // Remove bits so that ScheduleBoundsUpdate will work:
         kid->RemoveStateBits(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
                              NS_FRAME_HAS_DIRTY_CHILDREN);
         // No need to invalidate the new kid's old bounds, so we just use
         // nsSVGUtils::ScheduleBoundsUpdate.
         nsSVGUtils::ScheduleBoundsUpdate(kid);
+        if (isFirstReflow) {
+          // Add back the NS_FRAME_FIRST_REFLOW bit:
+          kid->AddStateBits(NS_FRAME_FIRST_REFLOW);
+        }
       }
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP