Bug 1447056: Don't poorly try to optimize out resizes from OnChromeLoaded. r=bz
☠☠ backed out by c0ed5c6f25ee ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 22 Mar 2018 17:24:39 +0100
changeset 409583 1caa948c67f3df85926787b8a5817c78b0275eb9
parent 409582 85bfd88be2256a63937df963f7781b217b523055
child 409584 c59eff0e8209d2a672eb4b39c9fe0f650b386dc7
push id33693
push usernbeleuzu@mozilla.com
push dateFri, 23 Mar 2018 09:52:16 +0000
treeherdermozilla-central@9cb650de48f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1447056, 1447292, 1446264
milestone61.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 1447056: Don't poorly try to optimize out resizes from OnChromeLoaded. r=bz aSpecWidth and aSpecHeight don't represent the actual width/height we are going to try to size the window to, because they can be affected by size constraints set on mWindow. So we can't optimize out a resize just because the specified size we have here matches the current size, because we might not be sizing to the given specified size. The alternative to this is making SetSizeConstraints do the resize, which is what bug 1447292 does in Cocoa. Note that this depends on bug 1446264 part 5, which I'll land before this. MozReview-Commit-ID: GdKqgttnTfU
xpfe/appshell/nsXULWindow.cpp
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -1297,28 +1297,22 @@ nsXULWindow::SetSpecifiedSize(int32_t aS
     }
     if (aSpecHeight > screenHeight) {
       aSpecHeight = screenHeight;
     }
   }
 
   NS_ASSERTION(mWindow, "we expected to have a window already");
 
-  int32_t currWidth = 0;
-  int32_t currHeight = 0;
-  GetSize(&currWidth, &currHeight); // returns device pixels
-
   // convert specified values to device pixels, and resize if needed
   double cssToDevPx = mWindow ? mWindow->GetDefaultScale().scale : 1.0;
   aSpecWidth = NSToIntRound(aSpecWidth * cssToDevPx);
   aSpecHeight = NSToIntRound(aSpecHeight * cssToDevPx);
   mIntrinsicallySized = false;
-  if (aSpecWidth != currWidth || aSpecHeight != currHeight) {
-    SetSize(aSpecWidth, aSpecHeight, false);
-  }
+  SetSize(aSpecWidth, aSpecHeight, false);
 }
 
 /* Miscellaneous persistent attributes are attributes named in the
    |persist| attribute, other than size and position. Those are special
    because it's important to load those before one of the misc
    attributes (sizemode) and they require extra processing. */
 bool nsXULWindow::LoadMiscPersistentAttributesFromXUL()
 {