Bug 1786048 - Part 2: Use layout device pixels for AppWindow primary content size. r=emilio
The getter used to return CSS pixels, while the setter expected layout device pixels. The nsIDocShellTreeOwner documentation used to suggest that CSS pixels are used for getters and setters of the primary content and the root shell size. Only the getter for the primary content size happend to match that documentation. Differential Revision: https://phabricator.services.mozilla.com/D161944
This commit is contained in:
@@ -2260,16 +2260,19 @@ static void SizeOpenedWindow(nsIDocShellTreeOwner* aTreeOwner,
|
||||
left = (LayoutDeviceCoord(devPxRect.x) / devToDesktopScale).Rounded();
|
||||
top = (LayoutDeviceCoord(devPxRect.y) / devToDesktopScale).Rounded();
|
||||
|
||||
int32_t contentWidth, contentHeight; // CSS pixels.
|
||||
LayoutDeviceIntSize contentSize;
|
||||
bool hasPrimaryContent = false;
|
||||
aTreeOwner->GetHasPrimaryContent(&hasPrimaryContent);
|
||||
if (hasPrimaryContent) {
|
||||
aTreeOwner->GetPrimaryContentSize(&contentWidth, &contentHeight);
|
||||
aTreeOwner->GetPrimaryContentSize(&contentSize.width,
|
||||
&contentSize.height);
|
||||
} else {
|
||||
aTreeOwner->GetRootShellSize(&contentWidth, &contentHeight);
|
||||
aTreeOwner->GetRootShellSize(&contentSize.width, &contentSize.height);
|
||||
}
|
||||
chromeWidth = width - contentWidth;
|
||||
chromeHeight = height - contentHeight;
|
||||
|
||||
CSSIntSize contentSizeCSS = RoundedToInt(contentSize / cssToDevScale);
|
||||
chromeWidth = width - contentSizeCSS.width;
|
||||
chromeHeight = height - contentSizeCSS.height;
|
||||
}
|
||||
|
||||
// Set up left/top
|
||||
|
||||
Reference in New Issue
Block a user