Bug 1577258 - early-return for noop resizes. r=botond

This avoids doing wasted work and sending spurious resize
events if this case would be hit.

In practice, it cannot be hit yet, I think, because
callers do check for this and bail out earlier. But
there's no assertion to that respect so this shouldn't
hurt.

Differential Revision: https://phabricator.services.mozilla.com/D43798

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-08-28 22:03:26 +00:00
parent 19057e1f9d
commit 0ec0984d05

View File

@ -1863,6 +1863,10 @@ nsresult PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight,
ResizeReflowOptions aOptions) {
MOZ_ASSERT(!mIsReflowing, "Shouldn't be in reflow here!");
if (aWidth == aOldWidth && aHeight == aOldHeight) {
return NS_OK;
}
nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
if (!rootFrame) {
// If we don't have a root frame yet, that means we haven't had our initial