mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1554861 - Disable clipping and scaling for top-level remote browsers to resolve regressions. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D35702 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
5a7cce5fce
commit
6b6abd3a36
@ -3332,16 +3332,16 @@ ScreenIntSize BrowserChild::GetInnerSize() {
|
||||
innerSize, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
|
||||
};
|
||||
|
||||
LayoutDeviceIntRect BrowserChild::GetVisibleRect() {
|
||||
CSSRect visibleRect;
|
||||
Maybe<LayoutDeviceIntRect> BrowserChild::GetVisibleRect() const {
|
||||
if (mIsTopLevel) {
|
||||
// We are conservative about visible rects for top-level browsers to avoid
|
||||
// artifacts when resizing
|
||||
visibleRect = CSSRect(CSSPoint(), mUnscaledInnerSize);
|
||||
} else {
|
||||
visibleRect = CSSPixel::FromAppUnits(mEffectsInfo.mVisibleRect);
|
||||
return Nothing();
|
||||
}
|
||||
return RoundedToInt(visibleRect * mPuppetWidget->GetDefaultScale());
|
||||
CSSRect visibleRectCSS = CSSPixel::FromAppUnits(mEffectsInfo.mVisibleRect);
|
||||
LayoutDeviceIntRect visibleRectLD =
|
||||
RoundedToInt(visibleRectCSS * mPuppetWidget->GetDefaultScale());
|
||||
return Some(visibleRectLD);
|
||||
}
|
||||
|
||||
ScreenIntRect BrowserChild::GetOuterRect() {
|
||||
|
@ -239,6 +239,8 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
|
||||
return mBrowserChildMessageManager;
|
||||
}
|
||||
|
||||
bool IsTopLevel() const { return mIsTopLevel; }
|
||||
|
||||
/**
|
||||
* MessageManagerCallback methods that we override.
|
||||
*/
|
||||
@ -549,7 +551,7 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
|
||||
|
||||
ScreenIntSize GetInnerSize();
|
||||
|
||||
LayoutDeviceIntRect GetVisibleRect();
|
||||
Maybe<LayoutDeviceIntRect> GetVisibleRect() const;
|
||||
|
||||
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
||||
void DoFakeShow(const ShowInfo& aShowInfo);
|
||||
|
@ -3792,11 +3792,14 @@ nsresult nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
|
||||
|
||||
// If we are in a remote browser, then apply clipping from ancestor browsers
|
||||
if (BrowserChild* browserChild = BrowserChild::GetFrom(presShell)) {
|
||||
LayoutDeviceIntRect unscaledVisibleRect = browserChild->GetVisibleRect();
|
||||
CSSRect visibleRect =
|
||||
unscaledVisibleRect / presContext->CSSToDevPixelScale();
|
||||
rootVisualOverflow.IntersectRect(rootVisualOverflow,
|
||||
CSSPixel::ToAppUnits(visibleRect));
|
||||
Maybe<LayoutDeviceIntRect> unscaledVisibleRect =
|
||||
browserChild->GetVisibleRect();
|
||||
if (unscaledVisibleRect) {
|
||||
CSSRect visibleRect =
|
||||
*unscaledVisibleRect / presContext->CSSToDevPixelScale();
|
||||
rootVisualOverflow.IntersectRect(rootVisualOverflow,
|
||||
CSSPixel::ToAppUnits(visibleRect));
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame();
|
||||
|
@ -2880,8 +2880,10 @@ FrameLayerBuilder* nsDisplayList::BuildLayers(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
// If we are in a remote browser, then apply scaling from ancestor browsers
|
||||
if (BrowserChild* browserChild = BrowserChild::GetFrom(presShell)) {
|
||||
resolutionX *= browserChild->GetEffectsInfo().mScaleX;
|
||||
resolutionY *= browserChild->GetEffectsInfo().mScaleY;
|
||||
if (!browserChild->IsTopLevel()) {
|
||||
resolutionX *= browserChild->GetEffectsInfo().mScaleX;
|
||||
resolutionY *= browserChild->GetEffectsInfo().mScaleY;
|
||||
}
|
||||
}
|
||||
|
||||
ContainerLayerParameters containerParameters(resolutionX, resolutionY);
|
||||
|
@ -1159,10 +1159,12 @@ LayoutDeviceIntRect PuppetWidget::GetScreenBounds() {
|
||||
}
|
||||
|
||||
LayoutDeviceIntSize PuppetWidget::GetCompositionSize() {
|
||||
if (!mBrowserChild) {
|
||||
Maybe<LayoutDeviceIntRect> visibleRect =
|
||||
mBrowserChild ? mBrowserChild->GetVisibleRect() : Nothing();
|
||||
if (!visibleRect) {
|
||||
return nsBaseWidget::GetCompositionSize();
|
||||
}
|
||||
return mBrowserChild->GetVisibleRect().Size();
|
||||
return visibleRect->Size();
|
||||
}
|
||||
|
||||
uint32_t PuppetWidget::GetMaxTouchPoints() const {
|
||||
|
Loading…
Reference in New Issue
Block a user