зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1619370 - Return the rect from BrowserChild::GetVisibleRect() in app units r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D91272
This commit is contained in:
Родитель
d5de56ef43
Коммит
093f7dcfb5
|
@ -3372,16 +3372,14 @@ ScreenIntSize BrowserChild::GetInnerSize() {
|
|||
innerSize, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
|
||||
};
|
||||
|
||||
Maybe<LayoutDeviceIntRect> BrowserChild::GetVisibleRect() const {
|
||||
Maybe<nsRect> BrowserChild::GetVisibleRect() const {
|
||||
if (mIsTopLevel) {
|
||||
// We are conservative about visible rects for top-level browsers to avoid
|
||||
// artifacts when resizing
|
||||
return Nothing();
|
||||
}
|
||||
CSSRect visibleRectCSS = CSSPixel::FromAppUnits(mEffectsInfo.mVisibleRect);
|
||||
LayoutDeviceIntRect visibleRectLD =
|
||||
RoundedToInt(visibleRectCSS * mPuppetWidget->GetDefaultScale());
|
||||
return Some(visibleRectLD);
|
||||
|
||||
return Some(mEffectsInfo.mVisibleRect);
|
||||
}
|
||||
|
||||
Maybe<LayoutDeviceRect>
|
||||
|
|
|
@ -576,7 +576,7 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
|
|||
ScreenIntSize GetInnerSize();
|
||||
CSSSize GetUnscaledInnerSize() { return mUnscaledInnerSize; }
|
||||
|
||||
Maybe<LayoutDeviceIntRect> GetVisibleRect() const;
|
||||
Maybe<nsRect> GetVisibleRect() const;
|
||||
|
||||
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
||||
void DoFakeShow(const ParentShowInfo&);
|
||||
|
|
|
@ -4030,13 +4030,10 @@ nsresult nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
|
|||
|
||||
// If we are in a remote browser, then apply clipping from ancestor browsers
|
||||
if (BrowserChild* browserChild = BrowserChild::GetFrom(presShell)) {
|
||||
Maybe<LayoutDeviceIntRect> unscaledVisibleRect =
|
||||
browserChild->GetVisibleRect();
|
||||
Maybe<nsRect> unscaledVisibleRect = browserChild->GetVisibleRect();
|
||||
|
||||
if (unscaledVisibleRect) {
|
||||
CSSRect visibleRect =
|
||||
*unscaledVisibleRect / presContext->CSSToDevPixelScale();
|
||||
rootInkOverflow.IntersectRect(rootInkOverflow,
|
||||
CSSPixel::ToAppUnits(visibleRect));
|
||||
rootInkOverflow.IntersectRect(rootInkOverflow, *unscaledVisibleRect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html reftest-zoom="1.5">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Testcase for bug 1619370</title>
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<iframe width="500" height="500" scrolling="no" frameborder="0" src="1619370-iframe.html"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html reftest-zoom="1.5" class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Testcase for bug 1619370</title>
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<iframe width="500" height="500" scrolling="no" frameborder="0" src="data:text/html,
|
||||
<div style='background-color: green; width: 100px; height: 100px; position: fixed; top: 495px;'></div>">
|
||||
</iframe>
|
||||
|
||||
<script type="text/javascript">
|
||||
function doTest() {
|
||||
document.documentElement.style["background-color"] = "blue";
|
||||
document.documentElement.classList.remove("reftest-wait");
|
||||
}
|
||||
|
||||
window.addEventListener("MozReftestInvalidate", doTest);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Testcase for bug 1619370</title>
|
||||
<style>
|
||||
#content {
|
||||
background-color: green;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
position: fixed;
|
||||
top: 495px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -45,3 +45,4 @@ fuzzy(0-2,0-40000) skip-if(!asyncPan) == 1464288-1.html 1464288-ref.html
|
|||
== 1544948-1.html 1544948-1-ref.html
|
||||
== 1551053-1.html 1551053-1-ref.html
|
||||
== 1553828-1.html 1553828-1-ref.html
|
||||
fuzzy-if(browserIsFission,0-1,0-300) == 1619370-1.html 1619370-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче