Bug 1393116 - In ResizeReflow, check width too, when refusing SizeToContent without root frame
MozReview-Commit-ID: 91D1cUB2JmW
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -1891,17 +1891,18 @@ nsresult
PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, nscoord aOldWidth, nscoord aOldHeight)
{
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) {
+ if (!rootFrame &&
+ (aHeight == NS_UNCONSTRAINEDSIZE || aWidth == 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;
}
mPresContext->SetVisibleArea(nsRect(0, 0, aWidth, aHeight));
// There isn't anything useful we can do if the initial reflow hasn't happened.