Bug 1447056: Don't poorly try to optimize out resizes from OnChromeLoaded. r?xidorn
The curSize stuff doesn't account for constraints that can be set during layout,
so if the window is sized to the same specified size, we'd avoid calling
SetSize, which prevents the constraining from happening.
This is the cross-platform fix equivalent to
bug 1447292, in practice.
Note that this depends on
bug 1446264 part 5, which I'll land before this.
MozReview-Commit-ID: GdKqgttnTfU
--- 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()
{