Bug 1319825 - Update the overflow areas of all descendants when we toggle opacity on a preserve-3d frame. r=tnikkel

This commit is contained in:
Matt Woodrow 2017-02-13 13:09:17 +13:00
parent 3f864c48ae
commit 990efceefc
4 changed files with 73 additions and 0 deletions

View File

@ -1233,6 +1233,13 @@ RestyleManagerBase::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
hint |= nsChangeHint_RepaintFrame;
}
// Opacity disables preserve-3d, so if we toggle it, then we also need
// to update the overflow areas of all potentially affected frames.
if ((hint & nsChangeHint_UpdateUsesOpacity) &&
frame->StyleDisplay()->mTransformStyle == NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D) {
hint |= nsChangeHint_UpdateSubtreeOverflow;
}
if (hint & nsChangeHint_UpdateBackgroundPosition) {
// For most frame types, DLBI can detect background position changes,
// so we only need to schedule a paint.

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<style>
.outer {
transform-style: preserve-3d;
width: 200px;
height: 200px;
opacity: 0.7;
}
.inner {
top: 50%;
transform: translateY(-50%);
background-color: green;
position:relative;
width: 200px;
height: 200px;
}
</style>
</head>
<body>
<div id="outer" class="outer">
<div class="inner">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
.outer {
transform-style: preserve-3d;
width: 200px;
height: 200px;
}
.inner {
top: 50%;
transform: translateY(-50%);
background-color: green;
position:relative;
width: 200px;
height: 200px;
}
</style>
</head>
<body>
<div id="outer" class="outer">
<div class="inner">
</div>
</div>
<script>
function doTest() {
document.getElementById("outer").style.opacity = 0.7;
document.documentElement.removeAttribute("class");
}
window.addEventListener("MozReftestInvalidate", doTest, false);
</script>
</body>
</html>

View File

@ -77,6 +77,7 @@ fuzzy(1,2000) fails-if(webrender) == opacity-preserve3d-1.html opacity-preserve3
fuzzy(1,15000) == opacity-preserve3d-2.html opacity-preserve3d-2-ref.html
fuzzy(1,10000) == opacity-preserve3d-3.html opacity-preserve3d-3-ref.html
fuzzy(1,10000) == opacity-preserve3d-4.html opacity-preserve3d-4-ref.html
+== opacity-preserve3d-5.html opacity-preserve3d-5-ref.html
fails-if(webrender) == snap-perspective-1.html snap-perspective-1-ref.html
fails-if(webrender) == mask-layer-1.html mask-layer-ref.html
fails-if(webrender) == mask-layer-2.html mask-layer-ref.html