Back out 6 changesets (bug 881832) for failures in test_Debugger.Source.prototype.element.html
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 23 May 2016 18:34:49 -0700
changeset 298592 d63acfaf882084a50b75de6d2a421ddd6f1d228b
parent 298591 3b45aeb5288a8510e749d82c874b54b9583154a1
child 298593 589b2826c6c5875717f653d2ed4e0bdf7c2b6b3f
push id19356
push usercbook@mozilla.com
push dateTue, 24 May 2016 13:16:37 +0000
treeherderfx-team@f074838712a0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs881832
milestone49.0a1
backs outfac50ce10b07df5f9ecd3bf02e756e0a0f9cddd6
32e01c144cd4f486bec4ccf6de0c0fa58567b4d3
779f5336b81e16af3e70a77f6a52025e23c839b5
95efd250e29f5bd7d2ad23a430c4336bc68ea04b
7fe79f07189f81c71fc37bb4e67df8d18bb4550b
8ee1824f2a57b40845bf915a8c94940dc43145b4
Back out 6 changesets (bug 881832) for failures in test_Debugger.Source.prototype.element.html CLOSED TREE Backed out changeset fac50ce10b07 (bug 881832) Backed out changeset 32e01c144cd4 (bug 881832) Backed out changeset 779f5336b81e (bug 881832) Backed out changeset 95efd250e29f (bug 881832) Backed out changeset 7fe79f07189f (bug 881832) Backed out changeset 8ee1824f2a57 (bug 881832)
docshell/base/nsDocShell.cpp
docshell/base/nsIContentViewer.idl
dom/base/nsFrameLoader.cpp
dom/events/test/test_bug602962.xul
dom/ipc/TabChild.cpp
dom/ipc/TabParent.cpp
embedding/browser/nsDocShellTreeOwner.cpp
embedding/browser/nsWebBrowser.cpp
layout/base/MobileViewportManager.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsIPresShell.h
layout/base/nsPresShell.cpp
layout/base/nsPresShell.h
layout/reftests/pagination/resize-reflow-001.inner.html
layout/reftests/pagination/resize-reflow-001.ref.html
layout/style/test/chrome/hover_helper.html
layout/xul/nsResizerFrame.cpp
view/nsViewManager.cpp
view/nsViewManager.h
widget/nsIBaseWindow.idl
xpfe/appshell/nsChromeTreeOwner.cpp
xpfe/appshell/nsContentTreeOwner.cpp
xpfe/appshell/nsWebShellWindow.cpp
xpfe/appshell/nsXULWindow.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -5591,17 +5591,17 @@ nsDocShell::GetCurrentDescriptor(nsISupp
 //*****************************************************************************
 
 NS_IMETHODIMP
 nsDocShell::InitWindow(nativeWindow aParentNativeWindow,
                        nsIWidget* aParentWidget, int32_t aX, int32_t aY,
                        int32_t aWidth, int32_t aHeight)
 {
   SetParentWidget(aParentWidget);
-  SetPositionAndSize(aX, aY, aWidth, aHeight, 0);
+  SetPositionAndSize(aX, aY, aWidth, aHeight, false);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::Create()
 {
   if (mCreated) {
@@ -5837,57 +5837,53 @@ nsDocShell::GetPosition(int32_t* aX, int
   return GetPositionAndSize(aX, aY, nullptr, nullptr);
 }
 
 NS_IMETHODIMP
 nsDocShell::SetSize(int32_t aWidth, int32_t aHeight, bool aRepaint)
 {
   int32_t x = 0, y = 0;
   GetPosition(&x, &y);
-  return SetPositionAndSize(x, y, aWidth, aHeight,
-                            aRepaint ? nsIBaseWindow::eRepaint : 0);
+  return SetPositionAndSize(x, y, aWidth, aHeight, aRepaint);
 }
 
 NS_IMETHODIMP
 nsDocShell::GetSize(int32_t* aWidth, int32_t* aHeight)
 {
   return GetPositionAndSize(nullptr, nullptr, aWidth, aHeight);
 }
 
 NS_IMETHODIMP
 nsDocShell::SetPositionAndSize(int32_t aX, int32_t aY, int32_t aWidth,
-                               int32_t aHeight, uint32_t aFlags)
+                               int32_t aHeight, bool aFRepaint)
 {
   mBounds.x = aX;
   mBounds.y = aY;
   mBounds.width = aWidth;
   mBounds.height = aHeight;
 
   // Hold strong ref, since SetBounds can make us null out mContentViewer
   nsCOMPtr<nsIContentViewer> viewer = mContentViewer;
   if (viewer) {
-    uint32_t cvflags = (aFlags & nsIBaseWindow::eDelayResize) ?
-                           nsIContentViewer::eDelayResize : 0;
     // XXX Border figured in here or is that handled elsewhere?
-    nsresult rv = viewer->SetBoundsWithFlags(mBounds, cvflags);
-    NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
+    NS_ENSURE_SUCCESS(viewer->SetBounds(mBounds), NS_ERROR_FAILURE);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetPositionAndSize(int32_t* aX, int32_t* aY, int32_t* aWidth,
                                int32_t* aHeight)
 {
   if (mParentWidget) {
     // ensure size is up-to-date if window has changed resolution
     LayoutDeviceIntRect r;
     mParentWidget->GetClientBounds(r);
-    SetPositionAndSize(mBounds.x, mBounds.y, r.width, r.height, 0);
+    SetPositionAndSize(mBounds.x, mBounds.y, r.width, r.height, false);
   }
 
   // We should really consider just getting this information from
   // our window instead of duplicating the storage and code...
   if (aWidth || aHeight) {
     // Caller wants to know our size; make sure to give them up to
     // date information.
     nsCOMPtr<nsIDocument> doc(do_GetInterface(GetAsSupports(mParent)));
--- a/docshell/base/nsIContentViewer.idl
+++ b/docshell/base/nsIContentViewer.idl
@@ -99,22 +99,16 @@ interface nsIContentViewer : nsISupports
 
   /**
    * Returns DOMDocument as nsIDocument and without addrefing.
    */
   [noscript,notxpcom] nsIDocument getDocument();
 
   [noscript] void getBounds(in nsIntRectRef aBounds);
   [noscript] void setBounds([const] in nsIntRectRef aBounds);
-  /**
-   * The 'aFlags' argument to setBoundsWithFlags is a set of these bits.
-   */
-  const unsigned long eDelayResize = 1;
-  [noscript] void setBoundsWithFlags([const] in nsIntRectRef aBounds,
-                                     in unsigned long aFlags);
 
   /**
    * The previous content viewer, which has been |close|d but not
    * |destroy|ed.
    */
   [noscript] attribute nsIContentViewer previousViewer;
 
   void move(in long aX, in long aY);
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -2333,18 +2333,17 @@ nsFrameLoader::UpdateBaseWindowPositionA
 
     if (!weakFrame.IsAlive()) {
       // GetPosition() killed us
       return;
     }
 
     ScreenIntSize size = aIFrame->GetSubdocumentSize();
 
-    baseWindow->SetPositionAndSize(x, y, size.width, size.height,
-                                   nsIBaseWindow::eDelayResize);
+    baseWindow->SetPositionAndSize(x, y, size.width, size.height, false);
   }
 }
 
 NS_IMETHODIMP
 nsFrameLoader::GetEventMode(uint32_t* aEventMode)
 {
   *aEventMode = mEventMode;
   return NS_OK;
--- a/dom/events/test/test_bug602962.xul
+++ b/dom/events/test/test_bug602962.xul
@@ -32,20 +32,18 @@ function doTest() {
   scrollbox = win.document.getElementById("page-scrollbox");
   sbo = scrollbox.boxObject;
   content = win.document.getElementById("page-box");
   content.style.width = 400 + "px";
   
   win.addEventListener("resize", function() {
     win.removeEventListener("resize", arguments.callee, false);
 
-    setTimeout(function(){
-      sbo.scrollBy(200, 0);
-      resize();
-    },0);
+    sbo.scrollBy(200, 0);
+    setTimeout(function() { resize(); }, 0);
   }, false);
 
   oldWidth = win.outerWidth;
   oldHeight = win.outerHeight;
   win.resizeTo(200, 400);
 }
 
 function resize() {
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1687,17 +1687,17 @@ TabChild::RecvUpdateDimensions(const CSS
     ScreenIntSize screenSize = GetInnerSize();
     ScreenIntRect screenRect = GetOuterRect();
 
     // Set the size on the document viewer before we update the widget and
     // trigger a reflow. Otherwise the MobileViewportManager reads the stale
     // size from the content viewer when it computes a new CSS viewport.
     nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
     baseWin->SetPositionAndSize(0, 0, screenSize.width, screenSize.height,
-                                nsIBaseWindow::eRepaint);
+                                true);
 
     mPuppetWidget->Resize(screenRect.x + clientOffset.x + chromeDisp.x,
                           screenRect.y + clientOffset.y + chromeDisp.y,
                           screenSize.width, screenSize.height, true);
 
     return true;
 }
 
@@ -3097,17 +3097,17 @@ TabChild::RecvUIResolutionChanged(const 
   if (mHasValidInnerSize && oldScreenSize != screenSize) {
     ScreenIntRect screenRect = GetOuterRect();
     mPuppetWidget->Resize(screenRect.x + mClientOffset.x + mChromeDisp.x,
                           screenRect.y + mClientOffset.y + mChromeDisp.y,
                           screenSize.width, screenSize.height, true);
 
     nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
     baseWin->SetPositionAndSize(0, 0, screenSize.width, screenSize.height,
-                                nsIBaseWindow::eRepaint);
+                                true);
   }
 
   return true;
 }
 
 bool
 TabChild::RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache)
 {
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -872,18 +872,17 @@ TabParent::RecvSetDimensions(const uint3
 
   int32_t cy = aCy;
   if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_CY) {
     treeOwnerAsWin->GetSize(&unused, &cy);
   }
 
   if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION &&
       aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) {
-    treeOwnerAsWin->SetPositionAndSize(x, y, cx, cy,
-                                       nsIBaseWindow::eRepaint);
+    treeOwnerAsWin->SetPositionAndSize(x, y, cx, cy, true);
     return true;
   }
 
   if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) {
     treeOwnerAsWin->SetPosition(x, y);
     mUpdatedDimensions = false;
     UpdatePosition();
     return true;
--- a/embedding/browser/nsDocShellTreeOwner.cpp
+++ b/embedding/browser/nsDocShellTreeOwner.cpp
@@ -642,17 +642,17 @@ nsDocShellTreeOwner::GetSize(int32_t* aC
     return ownerWin->GetDimensions(nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER,
                                    nullptr, nullptr, aCX, aCY);
   }
   return NS_ERROR_NULL_POINTER;
 }
 
 NS_IMETHODIMP
 nsDocShellTreeOwner::SetPositionAndSize(int32_t aX, int32_t aY, int32_t aCX,
-                                        int32_t aCY, uint32_t aFlags)
+                                        int32_t aCY, bool aRepaint)
 {
   nsCOMPtr<nsIEmbeddingSiteWindow> ownerWin = GetOwnerWin();
   if (ownerWin) {
     return ownerWin->SetDimensions(
       nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER |
         nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION,
       aX, aY, aCX, aCY);
   }
--- a/embedding/browser/nsWebBrowser.cpp
+++ b/embedding/browser/nsWebBrowser.cpp
@@ -1145,17 +1145,17 @@ nsWebBrowser::InitWindow(nativeWindow aP
   NS_ENSURE_STATE(!mDocShell || mInitInfo);
 
   if (aParentWidget) {
     NS_ENSURE_SUCCESS(SetParentWidget(aParentWidget), NS_ERROR_FAILURE);
   } else
     NS_ENSURE_SUCCESS(SetParentNativeWindow(aParentNativeWindow),
                       NS_ERROR_FAILURE);
 
-  NS_ENSURE_SUCCESS(SetPositionAndSize(aX, aY, aCX, aCY, 0),
+  NS_ENSURE_SUCCESS(SetPositionAndSize(aX, aY, aCX, aCY, false),
                     NS_ERROR_FAILURE);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::Create()
 {
@@ -1320,68 +1320,66 @@ nsWebBrowser::SetPositionDesktopPix(int3
 NS_IMETHODIMP
 nsWebBrowser::SetPosition(int32_t aX, int32_t aY)
 {
   int32_t cx = 0;
   int32_t cy = 0;
 
   GetSize(&cx, &cy);
 
-  return SetPositionAndSize(aX, aY, cx, cy, 0);
+  return SetPositionAndSize(aX, aY, cx, cy, false);
 }
 
 NS_IMETHODIMP
 nsWebBrowser::GetPosition(int32_t* aX, int32_t* aY)
 {
   return GetPositionAndSize(aX, aY, nullptr, nullptr);
 }
 
 NS_IMETHODIMP
 nsWebBrowser::SetSize(int32_t aCX, int32_t aCY, bool aRepaint)
 {
   int32_t x = 0;
   int32_t y = 0;
 
   GetPosition(&x, &y);
 
-  return SetPositionAndSize(x, y, aCX, aCY,
-                            aRepaint ? nsIBaseWindow::eRepaint : 0);
+  return SetPositionAndSize(x, y, aCX, aCY, aRepaint);
 }
 
 NS_IMETHODIMP
 nsWebBrowser::GetSize(int32_t* aCX, int32_t* aCY)
 {
   return GetPositionAndSize(nullptr, nullptr, aCX, aCY);
 }
 
 NS_IMETHODIMP
 nsWebBrowser::SetPositionAndSize(int32_t aX, int32_t aY,
-                                 int32_t aCX, int32_t aCY, uint32_t aFlags)
+                                 int32_t aCX, int32_t aCY, bool aRepaint)
 {
   if (!mDocShell) {
     mInitInfo->x = aX;
     mInitInfo->y = aY;
     mInitInfo->cx = aCX;
     mInitInfo->cy = aCY;
   } else {
     int32_t doc_x = aX;
     int32_t doc_y = aY;
 
     // If there is an internal widget we need to make the docShell coordinates
     // relative to the internal widget rather than the calling app's parent.
     // We also need to resize our widget then.
     if (mInternalWidget) {
       doc_x = doc_y = 0;
-      NS_ENSURE_SUCCESS(mInternalWidget->Resize(aX, aY, aCX, aCY,
-                                                !!(aFlags & nsIBaseWindow::eRepaint)),
+      NS_ENSURE_SUCCESS(mInternalWidget->Resize(aX, aY, aCX, aCY, aRepaint),
                         NS_ERROR_FAILURE);
     }
     // Now reposition/ resize the doc
     NS_ENSURE_SUCCESS(
-      mDocShellAsWin->SetPositionAndSize(doc_x, doc_y, aCX, aCY, aFlags),
+      mDocShellAsWin->SetPositionAndSize(doc_x, doc_y, aCX, aCY, aRepaint),
       NS_ERROR_FAILURE);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::GetPositionAndSize(int32_t* aX, int32_t* aY,
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -369,21 +369,17 @@ MobileViewportManager::RefreshViewportSi
       displayWidthChangeRatio);
     MVM_LOG("%p: New zoom is %f\n", this, zoom.scale);
     UpdateSPCSPS(displaySize, zoom);
   }
   if (gfxPlatform::AsyncPanZoomEnabled()) {
     UpdateDisplayPortMargins();
   }
 
-  CSSSize oldSize = mMobileViewportSize;
-
   // Update internal state.
   mIsFirstPaint = false;
   mMobileViewportSize = viewport;
 
   // Kick off a reflow.
   mPresShell->ResizeReflowIgnoreOverride(
     nsPresContext::CSSPixelsToAppUnits(viewport.width),
-    nsPresContext::CSSPixelsToAppUnits(viewport.height),
-    nsPresContext::CSSPixelsToAppUnits(oldSize.width),
-    nsPresContext::CSSPixelsToAppUnits(oldSize.height));
+    nsPresContext::CSSPixelsToAppUnits(viewport.height));
 }
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1900,33 +1900,32 @@ nsDocumentViewer::SetPreviousViewer(nsIC
     }
   }
 
   mPreviousViewer = aViewer;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocumentViewer::SetBoundsWithFlags(const nsIntRect& aBounds, uint32_t aFlags)
+nsDocumentViewer::SetBounds(const nsIntRect& aBounds)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
 
   mBounds = aBounds;
 
   if (mWindow && !mAttachedToParent) {
     // Resize the widget, but don't trigger repaint. Layout will generate
     // repaint requests during reflow.
     mWindow->Resize(aBounds.x, aBounds.y,
                     aBounds.width, aBounds.height,
                     false);
   } else if (mPresContext && mViewManager) {
     int32_t p2a = mPresContext->AppUnitsPerDevPixel();
     mViewManager->SetWindowDimensions(NSIntPixelsToAppUnits(mBounds.width, p2a),
-                                      NSIntPixelsToAppUnits(mBounds.height, p2a),
-                                      !!(aFlags & nsIContentViewer::eDelayResize));
+                                      NSIntPixelsToAppUnits(mBounds.height, p2a));
   }
 
   // If there's a previous viewer, it's the one that's actually showing,
   // so be sure to resize it as well so it paints over the right area.
   // This may slow down the performance of the new page load, but resize
   // during load is also probably a relatively unusual condition
   // relating to things being hidden while something is loaded.  It so
   // happens that Firefox does this a good bit with its infobar, and it
@@ -1935,22 +1934,16 @@ nsDocumentViewer::SetBoundsWithFlags(con
     nsCOMPtr<nsIContentViewer> previousViewer = mPreviousViewer;
     previousViewer->SetBounds(aBounds);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocumentViewer::SetBounds(const nsIntRect& aBounds)
-{
-  return SetBoundsWithFlags(aBounds, 0);
-}
-
-NS_IMETHODIMP
 nsDocumentViewer::Move(int32_t aX, int32_t aY)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
   mBounds.MoveTo(aX, aY);
   if (mWindow) {
     mWindow->Move(aX, aY);
   }
   return NS_OK;
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -424,22 +424,22 @@ public:
    * Calling Initialize can execute arbitrary script.
    */
   virtual nsresult Initialize(nscoord aWidth, nscoord aHeight) = 0;
 
   /**
    * Reflow the frame model into a new width and height.  The
    * coordinates for aWidth and aHeight must be in standard nscoord's.
    */
-  virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth = 0, nscoord aOldHeight = 0) = 0;
+  virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight) = 0;
   /**
    * Do the same thing as ResizeReflow but even if ResizeReflowOverride was
    * called previously.
    */
-  virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight) = 0;
+  virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight) = 0;
 
   /**
    * Returns true if ResizeReflowOverride has been called.
    */
   virtual bool GetIsViewportOverridden() = 0;
 
   /**
    * Return true if the presshell expects layout flush.
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -1802,64 +1802,65 @@ PresShell::sPaintSuppressionCallback(nsI
 
 void
 PresShell::AsyncResizeEventCallback(nsITimer* aTimer, void* aPresShell)
 {
   static_cast<PresShell*>(aPresShell)->FireResizeEvent();
 }
 
 nsresult
-PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight)
+PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
 {
   if (mZoomConstraintsClient) {
     // If we have a ZoomConstraintsClient and the available screen area
     // changed, then we might need to disable double-tap-to-zoom, so notify
     // the ZCC to update itself.
     mZoomConstraintsClient->ScreenSizeChanged();
   }
   if (mMobileViewportManager) {
     // If we have a mobile viewport manager, request a reflow from it. It can
     // recompute the final CSS viewport and trigger a call to
     // ResizeReflowIgnoreOverride if it changed.
     mMobileViewportManager->RequestReflow();
     return NS_OK;
   }
 
-  return ResizeReflowIgnoreOverride(aWidth, aHeight, aOldWidth, aOldHeight);
+  return ResizeReflowIgnoreOverride(aWidth, aHeight);
 }
 
 nsresult
-PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight)
+PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
 {
   NS_PRECONDITION(!mIsReflowing, "Shouldn't be in reflow here!");
 
   // If we don't have a root frame yet, that means we haven't had our initial
   // reflow... If that's the case, and aWidth or aHeight is unconstrained,
   // ignore them altogether.
   nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
   if (!rootFrame && aHeight == NS_UNCONSTRAINEDSIZE) {
     // We can't do the work needed for SizeToContent without a root
     // frame, and we want to return before setting the visible area.
     return NS_ERROR_NOT_AVAILABLE;
   }
 
+  nsSize oldVisibleSize = mPresContext->GetVisibleArea().Size();
   mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight));
 
   // There isn't anything useful we can do if the initial reflow hasn't happened.
   if (!rootFrame) {
     return NS_OK;
   }
 
   WritingMode wm = rootFrame->GetWritingMode();
   NS_PRECONDITION((wm.IsVertical() ? aHeight : aWidth) != NS_UNCONSTRAINEDSIZE,
                   "shouldn't use unconstrained isize anymore");
 
   const bool isBSizeChanging = wm.IsVertical()
-                               ? aOldWidth != aWidth
-                               : aOldHeight != aHeight;
+                               ? oldVisibleSize.width != aWidth
+                               : oldVisibleSize.height != aHeight;
 
   RefPtr<nsViewManager> viewManagerDeathGrip = mViewManager;
   // Take this ref after viewManager so it'll make sure to go away first.
   nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
 
   if (!GetPresContext()->SuppressingResizeReflow()) {
     // Have to make sure that the content notifications are flushed before we
     // start messing with the frame model; otherwise we can get content doubling.
@@ -3648,26 +3649,16 @@ PresShell::ScheduleViewManagerFlush(Pain
   if (presContext) {
     presContext->RefreshDriver()->ScheduleViewManagerFlush();
   }
   if (mDocument) {
     mDocument->SetNeedLayoutFlush();
   }
 }
 
-bool
-FlushLayoutRecursive(nsIDocument* aDocument,
-                     void* aData = nullptr)
-{
-  MOZ_ASSERT(!aData);
-  aDocument->EnumerateSubDocuments(FlushLayoutRecursive, nullptr);
-  aDocument->FlushPendingNotifications(Flush_Layout);
-  return true;
-}
-
 void
 PresShell::DispatchSynthMouseMove(WidgetGUIEvent* aEvent,
                                   bool aFlushOnHoverChange)
 {
   RestyleManagerHandle restyleManager = mPresContext->RestyleManager();
   if (restyleManager->IsServo()) {
     NS_ERROR("stylo: cannot dispatch synthetic mouse moves when using a "
              "ServoRestyleManager yet");
@@ -3682,20 +3673,17 @@ PresShell::DispatchSynthMouseMove(Widget
   targetView->GetViewManager()->DispatchEvent(aEvent, targetView, &status);
   if (MOZ_UNLIKELY(mIsDestroying)) {
     return;
   }
   if (aFlushOnHoverChange &&
       hoverGenerationBefore != restyleManager->AsGecko()->GetHoverGeneration()) {
     // Flush so that the resulting reflow happens now so that our caller
     // can suppress any synthesized mouse moves caused by that reflow.
-    // This code only ever runs for the root document, but :hover changes
-    // can happen in descendant documents too, so make sure we flush
-    // all of them.
-    FlushLayoutRecursive(mDocument);
+    FlushPendingNotifications(Flush_Layout);
   }
 }
 
 void
 PresShell::ClearMouseCaptureOnView(nsView* aView)
 {
   if (gCaptureInfo.mContent) {
     if (aView) {
--- a/layout/base/nsPresShell.h
+++ b/layout/base/nsPresShell.h
@@ -113,18 +113,18 @@ public:
   NS_IMETHOD GetDisplaySelection(int16_t *aToggle) override;
   NS_IMETHOD ScrollSelectionIntoView(SelectionType aType, SelectionRegion aRegion,
                                      int16_t aFlags) override;
   NS_IMETHOD RepaintSelection(SelectionType aType) override;
 
   virtual void BeginObservingDocument() override;
   virtual void EndObservingDocument() override;
   virtual nsresult Initialize(nscoord aWidth, nscoord aHeight) override;
-  virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight, nscoord aOldWidth = 0, nscoord aOldHeight = 0) override;
-  virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight) override;
+  virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight) override;
+  virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight) override;
   virtual nsIPageSequenceFrame* GetPageSequenceFrame() const override;
   virtual nsCanvasFrame* GetCanvasFrame() const override;
 
   virtual nsIFrame* GetPlaceholderFrameFor(nsIFrame* aFrame) const override;
   virtual void FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
                                 nsFrameState aBitToAdd,
                                 ReflowRootHandling aRootHandling =
                                   eInferFromBitToAdd) override;
--- a/layout/reftests/pagination/resize-reflow-001.inner.html
+++ b/layout/reftests/pagination/resize-reflow-001.inner.html
@@ -7,17 +7,17 @@
     html { overflow: hidden }
   </style>
 </head>
 <body>
 
 <div style="-moz-column-width: 12em;
             border: silver solid;
             height: 5em;">
-  <div style="border: solid;
+  <div style="border: dotted;
               background: aqua;
               color: gray;">
         blah<br>
         blah<br>
         blah<br>
         blah
   </div>
 </div>
--- a/layout/reftests/pagination/resize-reflow-001.ref.html
+++ b/layout/reftests/pagination/resize-reflow-001.ref.html
@@ -3,17 +3,17 @@
 <head>
   <title>Resize Reflow Test</title>
 </head>
 <body style="width: 28em">
 
 <div style="-moz-column-width: 12em;
             border: silver solid;
             height: 5em;">
-  <div style="border: solid;
+  <div style="border: dotted;
               background: aqua;
               color: gray;">
         blah<br>
         blah<br>
         blah<br>
         blah
   </div>
 </div>
--- a/layout/style/test/chrome/hover_helper.html
+++ b/layout/style/test/chrome/hover_helper.html
@@ -141,121 +141,136 @@ function step5() {
 }
 
 var step6called = false;
 function step6() {
     is(step6called, false, "step6 called only once");
     step6called = true;
     is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
        ":hover does not apply");
+    setResize("step7()");
     synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
-    setTimeout(step7, 500); // time to detect oscillations if they exist
 }
 
 var step7called = false;
 function step7() {
-    is(step7called, false, "step7 called only once (more than two cycles of oscillation)");
-    if (step7called)
+    is(step7called, false, "step7 called only once");
+    step7called = true;
+    if (getComputedStyle(iframe, "").width == "50px") {
+        // The two resize events may be coalesced into a single one.
+        step8();
         return;
-    step7called = true;
+    }
+    is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
+       ":hover applies");
+    setResize("step8()");
+    /* expect to get a second resize from the oscillation */
+}
+
+var step8called = false;
+function step8() {
+    is(step8called, false, "step8 called only once (more than two cycles of oscillation)");
+    if (step8called)
+        return;
+    step8called = true;
     is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
        ":hover does not apply");
-    setTimeout(step8, 500); // time to detect oscillations if they exist
+    setTimeout(step9, 500); // time to detect oscillations if they exist
 }
 
 /* test the same case with scrolltop */
 
-var step8called = false;
-function step8() {
-    is(step8called, false, "step8 called only once");
-    step8called = true;
-    iframe.contentDocument.body.removeAttribute("onresize");
-    /* move the mouse out of the way */
-    synthesizeMouse(divtwoparent, 200, 5, moveEvent, window);
-    divtwoparent.scrollLeft = 5;
-    setResize("step9()");
-    synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
-    /* mouse now over 7, 5 */
-}
-
 var step9called = false;
 function step9() {
     is(step9called, false, "step9 called only once");
     step9called = true;
-    is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
-       ":hover applies");
+    iframe.contentDocument.body.removeAttribute("onresize");
+    /* move the mouse out of the way */
+    synthesizeMouse(divtwoparent, 200, 5, moveEvent, window);
+    divtwoparent.scrollLeft = 5;
     setResize("step10()");
-    divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
+    synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
+    /* mouse now over 7, 5 */
 }
 
 var step10called = false;
 function step10() {
     is(step10called, false, "step10 called only once");
     step10called = true;
-    if (getComputedStyle(iframe, "").width == "100px") {
-        // The two resize events may be coalesced into a single one.
-        step11();
-        return;
-    }
-    is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
-       ":hover does not apply");
+    is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
+       ":hover applies");
     setResize("step11()");
-    /* expect to get a second resize from the oscillation */
+    divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
 }
 
 var step11called = false;
 function step11() {
-    is(step11called, false, "step11 called only once (more than two cycles of oscillation)");
-    if (step11called)
-        return;
+    is(step11called, false, "step11 called only once");
     step11called = true;
-    is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
-       ":hover applies");
-    setTimeout(step12, 500); // time to detect oscillations if they exist
+    if (getComputedStyle(iframe, "").width == "100px") {
+        // The two resize events may be coalesced into a single one.
+        step12();
+        return;
+    }
+    is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
+       ":hover does not apply");
+    setResize("step12()");
+    /* expect to get a second resize from the oscillation */
 }
 
 var step12called = false;
 function step12() {
-    is(step12called, false, "step12 called only once");
+    is(step12called, false, "step12 called only once (more than two cycles of oscillation)");
+    if (step12called)
+        return;
     step12called = true;
-    setResize("step13()");
-    divtwoparent.scrollLeft = 25; /* mouse now over 27,5 */
+    is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
+       ":hover applies");
+    setTimeout(step13, 500); // time to detect oscillations if they exist
 }
 
 var step13called = false;
 function step13() {
     is(step13called, false, "step13 called only once");
     step13called = true;
-    is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
-       ":hover does not apply");
     setResize("step14()");
-    divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
+    divtwoparent.scrollLeft = 25; /* mouse now over 27,5 */
 }
 
 var step14called = false;
 function step14() {
     is(step14called, false, "step14 called only once");
     step14called = true;
+    is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
+       ":hover does not apply");
+    setResize("step15()");
+    divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
+}
+
+var step15called = false;
+function step15() {
+    is(step15called, false, "step15 called only once");
+    step15called = true;
     if (getComputedStyle(iframe, "").width == "50px") {
         // The two resize events may be coalesced into a single one.
-        step15();
+        step16();
         return;
     }
     is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
        ":hover applies");
-    setResize("step15()");
+    setResize("step16()");
     /* expect to get a second resize from the oscillation */
 }
 
-var step15called = false;
-function step15() {
-    is(step15called, false, "step15 called only once (more than two cycles of oscillation)");
-    if (step15called)
+var step16called = false;
+function step16() {
+    is(step16called, false, "step16 called only once (more than two cycles of oscillation)");
+    if (step16called)
         return;
-    step15called = true;
+    step16called = true;
     is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
        ":hover does not apply");
     setTimeout(finish, 500); // time to detect oscillations if they exist
 }
 
 function finish() {
     document.getElementById("display").style.display = "none";
 
--- a/layout/xul/nsResizerFrame.cpp
+++ b/layout/xul/nsResizerFrame.cpp
@@ -280,18 +280,17 @@ nsResizerFrame::HandleEvent(nsPresContex
             (!menuPopupFrame->IsAnchored() ||
              menuPopupFrame->PopupLevel() != ePopupLevelParent)) {
 
           CSSPoint cssPos = rect.TopLeft() / aPresContext->CSSToDevPixelScale();
           menuPopupFrame->MoveTo(RoundedToInt(cssPos), true);
         }
       }
       else {
-        window->SetPositionAndSize(rect.x, rect.y, rect.width, rect.height,
-                                   nsIBaseWindow::eRepaint); // do the repaint.
+        window->SetPositionAndSize(rect.x, rect.y, rect.width, rect.height, true); // do the repaint.
       }
 
       doDefault = false;
     }
   }
   break;
 
   case eMouseClick: {
--- a/view/nsViewManager.cpp
+++ b/view/nsViewManager.cpp
@@ -184,17 +184,17 @@ void nsViewManager::DoSetWindowDimension
 {
   nsRect oldDim = mRootView->GetDimensions();
   nsRect newDim(0, 0, aWidth, aHeight);
   // We care about resizes even when one dimension is already zero.
   if (!oldDim.IsEqualEdges(newDim)) {
     // Don't resize the widget. It is already being set elsewhere.
     mRootView->SetDimensions(newDim, true, false);
     if (mPresShell)
-      mPresShell->ResizeReflow(aWidth, aHeight, oldDim.width, oldDim.height);
+      mPresShell->ResizeReflow(aWidth, aHeight);
   }
 }
 
 bool
 nsViewManager::ShouldDelayResize() const
 {
   MOZ_ASSERT(mRootView);
   if (!mRootView->IsEffectivelyVisible() ||
@@ -205,20 +205,20 @@ nsViewManager::ShouldDelayResize() const
     if (rd->IsResizeSuppressed()) {
       return true;
     }
   }
   return false;
 }
 
 void
-nsViewManager::SetWindowDimensions(nscoord aWidth, nscoord aHeight, bool aDelayResize)
+nsViewManager::SetWindowDimensions(nscoord aWidth, nscoord aHeight)
 {
   if (mRootView) {
-    if (!ShouldDelayResize() && !aDelayResize) {
+    if (!ShouldDelayResize()) {
       if (mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
           mDelayedResize != nsSize(aWidth, aHeight)) {
         // We have a delayed resize; that now obsolete size may already have
         // been flushed to the PresContext so we need to update the PresContext
         // with the new size because if the new size is exactly the same as the
         // root view's current size then DoSetWindowDimensions will not
         // request a resize reflow (which would correct it). See bug 617076.
         mDelayedResize = nsSize(aWidth, aHeight);
--- a/view/nsViewManager.h
+++ b/view/nsViewManager.h
@@ -84,18 +84,17 @@ public:
 
   /**
    * Set the dimensions of the root window.
    * Called if the root window is resized. The dimensions are in
    * twips
    * @param aWidth of window in twips
    * @param aHeight of window in twips
    */
-  void SetWindowDimensions(nscoord aWidth, nscoord aHeight,
-                           bool aDelayResize = false);
+  void SetWindowDimensions(nscoord aWidth, nscoord aHeight);
 
   /**
    * Do any resizes that are pending.
    */
   void FlushDelayedResize(bool aDoReflow);
 
   /**
    * Called to inform the view manager that the entire area of a view
--- a/widget/nsIBaseWindow.idl
+++ b/widget/nsIBaseWindow.idl
@@ -108,28 +108,22 @@ interface nsIBaseWindow : nsISupports
 	*/
 	void setSize(in long cx, in long cy, in boolean fRepaint);
 
 	/*
 	Gets the width and height of the control.
 	*/
 	void getSize(out long cx, out long cy);
 
-	/**
-	 * The 'flags' argument to setPositionAndSize is a set of these bits.
-	 */
-	const unsigned long eRepaint = 1;
-	const unsigned long eDelayResize = 2;
-
 	/*
 	Convenience function combining the SetPosition and SetSize into one call.
 	Also is more efficient than calling both.
 	*/
 	void setPositionAndSize(in long x, in long y, in long cx, in long cy, 
-		in unsigned long flags);
+		in boolean fRepaint);
 		
 	/*
 	Convenience function combining the GetPosition and GetSize into one call.
 	Also is more efficient than calling both.
 	*/
 	void getPositionAndSize(out long x, out long y, out long cx, out long cy);
 	 
 	/** 
--- a/xpfe/appshell/nsChromeTreeOwner.cpp
+++ b/xpfe/appshell/nsChromeTreeOwner.cpp
@@ -352,17 +352,17 @@ nsChromeTreeOwner::GetTargetableShellCou
 //*****************************************************************************
 // nsChromeTreeOwner::nsIBaseWindow
 //*****************************************************************************   
 
 NS_IMETHODIMP nsChromeTreeOwner::InitWindow(nativeWindow aParentNativeWindow,
    nsIWidget* parentWidget, int32_t x, int32_t y, int32_t cx, int32_t cy)   
 {
    // Ignore widget parents for now.  Don't think those are a vaild thing to call.
-   NS_ENSURE_SUCCESS(SetPositionAndSize(x, y, cx, cy, 0), NS_ERROR_FAILURE);
+   NS_ENSURE_SUCCESS(SetPositionAndSize(x, y, cx, cy, false), NS_ERROR_FAILURE);
 
    return NS_OK;
 }
 
 NS_IMETHODIMP nsChromeTreeOwner::Create()
 {
    NS_ASSERTION(false, "You can't call this");
    return NS_ERROR_UNEXPECTED;
@@ -412,20 +412,20 @@ NS_IMETHODIMP nsChromeTreeOwner::SetSize
 
 NS_IMETHODIMP nsChromeTreeOwner::GetSize(int32_t* cx, int32_t* cy)
 {
    NS_ENSURE_STATE(mXULWindow);
    return mXULWindow->GetSize(cx, cy);
 }
 
 NS_IMETHODIMP nsChromeTreeOwner::SetPositionAndSize(int32_t x, int32_t y, int32_t cx,
-   int32_t cy, uint32_t aFlags)
+   int32_t cy, bool fRepaint)
 {
    NS_ENSURE_STATE(mXULWindow);
-   return mXULWindow->SetPositionAndSize(x, y, cx, cy, aFlags);
+   return mXULWindow->SetPositionAndSize(x, y, cx, cy, fRepaint);
 }
 
 NS_IMETHODIMP nsChromeTreeOwner::GetPositionAndSize(int32_t* x, int32_t* y, int32_t* cx,
    int32_t* cy)
 {
    NS_ENSURE_STATE(mXULWindow);
    return mXULWindow->GetPositionAndSize(x, y, cx, cy);
 }
--- a/xpfe/appshell/nsContentTreeOwner.cpp
+++ b/xpfe/appshell/nsContentTreeOwner.cpp
@@ -594,17 +594,17 @@ NS_IMETHODIMP nsContentTreeOwner::ExitMo
 //*****************************************************************************
 // nsContentTreeOwner::nsIBaseWindow
 //*****************************************************************************   
 
 NS_IMETHODIMP nsContentTreeOwner::InitWindow(nativeWindow aParentNativeWindow,
    nsIWidget* parentWidget, int32_t x, int32_t y, int32_t cx, int32_t cy)   
 {
    // Ignore wigdet parents for now.  Don't think those are a vaild thing to call.
-   NS_ENSURE_SUCCESS(SetPositionAndSize(x, y, cx, cy, 0), NS_ERROR_FAILURE);
+   NS_ENSURE_SUCCESS(SetPositionAndSize(x, y, cx, cy, false), NS_ERROR_FAILURE);
 
    return NS_OK;
 }
 
 NS_IMETHODIMP nsContentTreeOwner::Create()
 {
    NS_ASSERTION(false, "You can't call this");
    return NS_ERROR_UNEXPECTED;
@@ -654,20 +654,20 @@ NS_IMETHODIMP nsContentTreeOwner::SetSiz
 
 NS_IMETHODIMP nsContentTreeOwner::GetSize(int32_t* aCX, int32_t* aCY)
 {
    NS_ENSURE_STATE(mXULWindow);
    return mXULWindow->GetSize(aCX, aCY);
 }
 
 NS_IMETHODIMP nsContentTreeOwner::SetPositionAndSize(int32_t aX, int32_t aY,
-   int32_t aCX, int32_t aCY, uint32_t aFlags)
+   int32_t aCX, int32_t aCY, bool aRepaint)
 {
    NS_ENSURE_STATE(mXULWindow);
-   return mXULWindow->SetPositionAndSize(aX, aY, aCX, aCY, aFlags);
+   return mXULWindow->SetPositionAndSize(aX, aY, aCX, aCY, aRepaint);
 }
 
 NS_IMETHODIMP nsContentTreeOwner::GetPositionAndSize(int32_t* aX, int32_t* aY,
    int32_t* aCX, int32_t* aCY)
 {
    NS_ENSURE_STATE(mXULWindow);
    return mXULWindow->GetPositionAndSize(aX, aY, aCX, aCY); 
 }
@@ -1053,18 +1053,17 @@ NS_INTERFACE_MAP_BEGIN(nsSiteWindow)
   NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
 NS_INTERFACE_MAP_END_AGGREGATED(mAggregator)
 
 NS_IMETHODIMP
 nsSiteWindow::SetDimensions(uint32_t aFlags,
                     int32_t aX, int32_t aY, int32_t aCX, int32_t aCY)
 {
   // XXX we're ignoring aFlags
-  return mAggregator->SetPositionAndSize(aX, aY, aCX, aCY,
-                                         nsIBaseWindow::eRepaint);
+  return mAggregator->SetPositionAndSize(aX, aY, aCX, aCY, true);
 }
 
 NS_IMETHODIMP
 nsSiteWindow::GetDimensions(uint32_t aFlags,
                     int32_t *aX, int32_t *aY, int32_t *aCX, int32_t *aCY)
 {
   // XXX we're ignoring aFlags
   return mAggregator->GetPositionAndSize(aX, aY, aCX, aCY);
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -276,17 +276,17 @@ nsWebShellWindow::WindowMoved(nsIWidget*
   return false;
 }
 
 bool
 nsWebShellWindow::WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight)
 {
   nsCOMPtr<nsIBaseWindow> shellAsWin(do_QueryInterface(mDocShell));
   if (shellAsWin) {
-    shellAsWin->SetPositionAndSize(0, 0, aWidth, aHeight, 0);
+    shellAsWin->SetPositionAndSize(0, 0, aWidth, aHeight, false);
   }
   // Persist size, but not immediately, in case this OS is firing
   // repeated size events as the user drags the sizing handle
   if (!IsLocked())
     SetPersistenceTimer(PAD_POSITION | PAD_SIZE | PAD_MISC);
   return true;
 }
 
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -636,29 +636,29 @@ NS_IMETHODIMP nsXULWindow::SetSize(int32
 }
 
 NS_IMETHODIMP nsXULWindow::GetSize(int32_t* aCX, int32_t* aCY)
 {
   return GetPositionAndSize(nullptr, nullptr, aCX, aCY);
 }
 
 NS_IMETHODIMP nsXULWindow::SetPositionAndSize(int32_t aX, int32_t aY, 
-   int32_t aCX, int32_t aCY, uint32_t aFlags)
+   int32_t aCX, int32_t aCY, bool aRepaint)
 {
   /* any attempt to set the window's size or position overrides the window's
      zoom state. this is important when these two states are competing while
      the window is being opened. but it should probably just always be so. */
   mWindow->SetSizeMode(nsSizeMode_Normal);
 
   mIntrinsicallySized = false;
 
   DesktopToLayoutDeviceScale scale = mWindow->GetDesktopToDeviceScale();
   DesktopRect rect = LayoutDeviceIntRect(aX, aY, aCX, aCY) / scale;
   nsresult rv = mWindow->Resize(rect.x, rect.y, rect.width, rect.height,
-                                !!(aFlags & nsIBaseWindow::eRepaint));
+                                aRepaint);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
   if (!mChromeLoaded) {
     // If we're called before the chrome is loaded someone obviously wants this
     // window at this size and position. We don't persist this one-time setting.
     mIgnoreXULPosition = true;
     mIgnoreXULSize = true;
     mIgnoreXULSizeMode = true;
     return NS_OK;