Bug 1452805 - Make sure we rebuild contents infront and behind stacking contexts if their size might have changed. r=miko

The test invalidates the z-index element, so that we do a partial build with just that and the DAG no longer knows the relative ordering between it and the other blue elements.
We then expand the size of the 'first' elements stacking context, and ensure that we provide enough intersecting items to know that we're on top of the z-index element.

MozReview-Commit-ID: KP7c3bnwfBd
* * *
[mq]: fix

MozReview-Commit-ID: EuraqvaUS35

--HG--
extra : rebase_source : 9e2e4f2dc661cc552891499a614d489625ea895d
This commit is contained in:
Matt Woodrow 2018-04-15 16:38:45 +12:00
Родитель 3f11f75aa1
Коммит 00069d57ec
4 изменённых файлов: 72 добавлений и 0 удалений

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

@ -2921,6 +2921,12 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
}
}
inTransform = true;
} else if (IsFixedPosContainingBlock()) {
// Restict the building area to the overflow rect for these frames, since
// RetainedDisplayListBuilder uses it to know if the size of the stacking
// context changed.
visibleRect.IntersectRect(visibleRect, GetVisualOverflowRect());
dirtyRect.IntersectRect(dirtyRect, GetVisualOverflowRect());
}
bool hasOverrideDirtyRect = false;

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

@ -0,0 +1,39 @@
<html class="reftest-wait">
<head>
<style>
div {
width: 200px;
height: 200px;
background-color: blue;
filter: greyscale(50%);
position: relative;
}
#second {
width: 600px;
height: 500px;
display: none;
background-color: green;
}
</style>
</head>
<body>
<div id="top" style="z-index:-4;"></div>
<div style="top: 10px;"></div>
<div style="top: 20px;">
<div id="second" style="top: -400px;"></div>
</div>
<script>
function doTest2() {
document.getElementById("second").style.display = "block";
document.documentElement.removeAttribute("class");
}
function doTest() {
document.getElementById("top").style.zIndex = -5;
setTimeout(doTest2, 500);
}
document.addEventListener("MozReftestInvalidate", doTest);
</script>
</body>
</html>

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

@ -0,0 +1,26 @@
<html>
<head>
<style>
div {
width: 200px;
height: 200px;
background-color: blue;
filter: greyscale(50%);
position: relative;
}
#second {
width: 600px;
height: 500px;
background-color: green;
}
</style>
</head>
<body>
<div id="top" style="z-index:-4;"></div>
<div style="top: 10px;"></div>
<div style="top: 20px;">
<div id="second" style="top: -400px;"></div>
</div>
</body>
</html>

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

@ -27,3 +27,4 @@ skip-if(!asyncPan) == 1437374-1.html 1437374-1-ref.html
== 1443027-2.html 1443027-ref.html
== 1443027-3.html 1443027-3-ref.html
== 1451971-1.html 1451971-ref.html
== 1452805-1.html 1452805-ref.html