mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00
Bug 1530584 - Correct placeholder overflow calculation. r=miko,mattwoodrow
The calculation of aOverflow rect for a placeholder contained in a transformed stacking context didn't take the transform into account, leading to an incorrect rect which artificially inflated the calculated rebuild region. Differential Revision: https://phabricator.services.mozilla.com/D21168 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
46602dc8b0
commit
ff5c70a292
@ -844,10 +844,12 @@ static bool ProcessFrameInternal(nsIFrame* aFrame,
|
||||
: nullptr;
|
||||
|
||||
if (placeholder) {
|
||||
// The rect aOverflow is in the coordinate space of the containing block.
|
||||
// Convert it to a coordinate space of the placeholder frame.
|
||||
nsRect placeholderOverflow =
|
||||
aOverflow + currentFrame->GetOffsetTo(placeholder);
|
||||
nsRect placeholderOverflow = aOverflow;
|
||||
auto rv = nsLayoutUtils::TransformRect(currentFrame, placeholder,
|
||||
placeholderOverflow);
|
||||
if (rv != nsLayoutUtils::TRANSFORM_SUCCEEDED) {
|
||||
placeholderOverflow = nsRect();
|
||||
}
|
||||
|
||||
CRR_LOG("Processing placeholder %p for OOF frame %p\n", placeholder,
|
||||
currentFrame);
|
||||
|
@ -2,6 +2,7 @@ skip-if(!retainedDisplayList) == retained-dl-style-change-1.html retained-dl-sty
|
||||
skip-if(!retainedDisplayList) == retained-dl-frame-deleted-1.html retained-dl-style-change-1-ref.html
|
||||
skip-if(!retainedDisplayList) == retained-dl-frame-created-1.html retained-dl-style-change-1-ref.html
|
||||
skip-if(!retainedDisplayList) == retained-dl-style-change-stacking-context-1.html retained-dl-style-change-stacking-context-1-ref.html
|
||||
skip-if(!retainedDisplayList) == retained-dl-style-change-stacking-context-2.html retained-dl-style-change-stacking-context-2-ref.html
|
||||
skip-if(!retainedDisplayList||!asyncPan) == retained-dl-async-scrolled-1.html retained-dl-async-scrolled-1-ref.html
|
||||
skip-if(!retainedDisplayList) == retained-dl-remove-for-ancestor-change-1.html retained-dl-remove-for-ancestor-change-1-ref.html
|
||||
skip-if(!retainedDisplayList) == retained-dl-scroll-out-of-view-1.html retained-dl-scroll-out-of-view-1-ref.html
|
||||
|
@ -0,0 +1,20 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
div {
|
||||
left: 50px;
|
||||
width:100px;
|
||||
height:100px;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div></div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,23 @@
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="transform-origin: left top 0px; transform: translate(50px, 0px) scale(0.5);">
|
||||
<div id="first" style="width: 100px; height: 200px; background-color: green; float: left;" class="reftest-no-display-list"></div>
|
||||
<div id="second" style="width: 100px; height: 200px; position: absolute; transform: translate(100px, 0px); background-color: red;"></div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
function doTest() {
|
||||
document.getElementById("second").style.backgroundColor = "green";
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
window.addEventListener("MozReftestInvalidate", doTest);
|
||||
</script>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user