Bug 1062792. Don't add clipped out parts of a layer to the opaque region. r=roc

This commit is contained in:
Timothy Nikkel 2014-10-21 20:33:12 -05:00
parent f7aebf9715
commit 919b8da6a8
4 changed files with 50 additions and 1 deletions

View File

@ -3593,7 +3593,13 @@ ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer
data->mAnimatedGeometryRoot = animatedGeometryRootToCover;
data->mFixedPosFrameForLayerData = e->mFixedPosFrameForLayerData;
}
data->mOpaqueRegion.Or(data->mOpaqueRegion, e->mOpaqueRegion);
nsIntRegion clippedOpaque = e->mOpaqueRegion;
const nsIntRect* clipRect = e->mLayer->GetClipRect();
if (clipRect) {
clippedOpaque.AndWith(*clipRect);
}
data->mOpaqueRegion.Or(data->mOpaqueRegion, clippedOpaque);
if (e->mHideAllLayersBelow) {
hideAll = true;
}

View File

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html class="reftest-wait" style="overflow: hidden;">
<head>
<script>
function scroll() {
document.getElementById("thediv").scrollTop = 400;
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="scroll();" style="overflow: hidden;">
<div style="background: white; position: absolute; top: 0; left: 0; bottom: 0; right: 0;">
<div style="background: yellow; height: 10%;"></div>
<div style="overflow: scroll; height: 90%;"
id="thediv">
<div style="background: purple; height: 4000px;"><div style="height: 500px; width: 100px; background: orange;"></div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html reftest-async-scroll class="reftest-wait" style="overflow: hidden;">
<head>
<script>
function scroll() {
document.getElementById("thediv").scrollTop = 400;
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="scroll();" style="overflow: hidden;">
<div style="background: white; position: absolute; top: 0; left: 0; bottom: 0; right: 0;">
<div style="background: yellow; height: 10%;"></div>
<div reftest-displayport-x="0" reftest-displayport-y="-300"
reftest-displayport-w="800" reftest-displayport-h="2000"
style="overflow: scroll; height: 90%;"
id="thediv">
<div style="background: purple; height: 4000px;"><div style="height: 500px; width: 100px; background: orange;"></div></div>
</div>
</div>
</body>
</html>

View File

@ -1832,6 +1832,7 @@ test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.htm
== 1059498-1.html 1059498-1-ref.html
== 1059498-2.html 1059498-1-ref.html
== 1059498-3.html 1059498-1-ref.html
fails-if(Android) == 1062792-1.html 1062792-1-ref.html
test-pref(dom.webcomponents.enabled,true) == 1066554-1.html 1066554-1-ref.html
== 1069716-1.html 1069716-1-ref.html
== 1078262-1.html about:blank