Backed out changeset 27045cd56940 (bug 1810614) for causing bc failures in browser/base/content/test/popups/browser_popup_resize.js CLOSED TREE

This commit is contained in:
Sandor Molnar 2023-01-17 03:22:58 +02:00
Родитель 41b78439d0
Коммит fbafccd735
1 изменённых файлов: 7 добавлений и 9 удалений

Просмотреть файл

@ -2213,18 +2213,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);
@ -2613,6 +2606,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;
@ -2641,7 +2639,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;