Skip to content

Commit

Permalink
Backed out changeset 7f9088d3354d (bug 1807838) for causing bc failur…
Browse files Browse the repository at this point in the history
…es on browser_modal_resize.js. CLOSED TREE
  • Loading branch information
Marian-Vasile Laza committed Jan 10, 2023
1 parent 358cf47 commit 2b766fd
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions xpfe/appshell/AppWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2228,18 +2228,11 @@ nsresult AppWindow::SetRootShellSize(int32_t aWidth, int32_t aHeight) {

NS_IMETHODIMP AppWindow::SizeShellTo(nsIDocShellTreeItem* aShellItem,
int32_t aCX, int32_t aCY) {
MOZ_ASSERT(aShellItem == mDocShell || aShellItem == mPrimaryContentShell);
if (aShellItem == mDocShell) {
auto newSize =
LayoutDeviceIntSize(aCX, aCY) + GetOuterToInnerSizeDifference(mWindow);
SetSize(newSize.width, newSize.height, /* aRepaint = */ true);
return NS_OK;
}

// XXXTAB This is wrong, we should actually reflow based on the passed in
// shell. For now we are hacking and doing delta sizing. This is bad
// because it assumes all size we add will go to the shell which probably
// won't happen.

nsCOMPtr<nsIBaseWindow> shellAsWin(do_QueryInterface(aShellItem));
NS_ENSURE_TRUE(shellAsWin, NS_ERROR_FAILURE);

Expand Down Expand Up @@ -2628,6 +2621,11 @@ void AppWindow::IntrinsicallySizeShell(const CSSIntSize& aWindowDiff,
return;
}
RefPtr<nsDocShell> docShell = mDocShell;
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
docShell->GetTreeOwner(getter_AddRefs(treeOwner));
if (!treeOwner) {
return;
}

CSSIntCoord maxWidth = 0;
CSSIntCoord maxHeight = 0;
Expand Down Expand Up @@ -2656,7 +2654,7 @@ void AppWindow::IntrinsicallySizeShell(const CSSIntSize& aWindowDiff,

int32_t width = pc->CSSPixelsToDevPixels(size->width);
int32_t height = pc->CSSPixelsToDevPixels(size->height);
SizeShellTo(docShell, width, height);
treeOwner->SizeShellTo(docShell, width, height);

// Update specified size for the final LoadPositionFromXUL call.
aSpecWidth = size->width + aWindowDiff.width;
Expand Down

0 comments on commit 2b766fd

Please sign in to comment.