Bug 1119117. Don't clip nsDisplayOpacity items, since some of its descendants maybe should not be clipped with the nsDisplayOpacity clip. r=mattwoodrow

--HG--
extra : rebase_source : 50ab1923ad5150197128a0862db2af96dfd41658
This commit is contained in:
Robert O'Callahan 2015-01-11 00:12:33 +13:00
parent ce6e3ca667
commit 0cdcaa1f30
6 changed files with 87 additions and 2 deletions

View File

@ -2022,7 +2022,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
if (isTransformed || useOpacity || useBlendMode || usingSVGEffects || useStickyPosition) {
if (isTransformed || useBlendMode || usingSVGEffects || useStickyPosition) {
// We don't need to pass ancestor clipping down to our children;
// everything goes inside a display item's child list, and the display
// item itself will be clipped.
@ -2138,6 +2138,11 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
* effects, wrap it up in an opacity item.
*/
else if (useOpacity && !resultList.IsEmpty()) {
// Don't clip nsDisplayOpacity items. We clip their descendants instead.
// The clip we would set on an element with opacity would clip
// all descendant content, but some should not be clipped.
DisplayListClipState::AutoSaveRestore opacityClipState(aBuilder);
opacityClipState.Clear();
resultList.AppendNewToTop(
new (aBuilder) nsDisplayOpacity(aBuilder, this, &resultList));
}

View File

@ -12,7 +12,7 @@ pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enable
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-layers-1.html split-layers-1-ref.html
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-layers-multi-scrolling-1.html split-layers-multi-scrolling-1-ref.html
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-opacity-layers-1.html split-opacity-layers-1-ref.html
fails pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-opacity-layers-1.html split-opacity-layers-1-ref.html
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == sticky-pos-scrollable-1.html sticky-pos-scrollable-1-ref.html
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == fixed-pos-scrollable-1.html fixed-pos-scrollable-1-ref.html
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == culling-1.html culling-1-ref.html

View File

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
#image {
position:fixed;
opacity:0.5;
left:0;
top:0;
width:100%;
height:100%;
background:blue;
}
</style>
</head>
<body>
<div id="image"></div>
</body>
</html>

View File

@ -0,0 +1,29 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
#d1 {
overflow:hidden;
height:0;
}
#d2 {
opacity:0.5;
}
#d3 {
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
background:blue;
}
</style>
</head>
<body>
<div id="d1">
<div id="d2">
<div id="d3"></div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,30 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
#d1 {
overflow:hidden;
height:0;
}
#d2 {
opacity:0.5;
}
#image {
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
background:blue;
}
</style>
</head>
<body>
<div id="d1">
<div id="d2" class="active">
<div id="image"></div>
<h2>ABCDEFG</h2>
</div>
</div>
</body>
</html>

View File

@ -1854,3 +1854,5 @@ fuzzy-if(winWidget&&!layersGPUAccelerated,1,31) fuzzy-if(B2G,128,75) == 1081185-
== 1105137-1.html 1105137-1-ref.html
fuzzy-if(d2d,36,304) HTTP(..) == 1116480-1-fakeitalic-overflow.html 1116480-1-fakeitalic-overflow-ref.html
== 1111753-1.html about:blank
== 1119117-1a.html 1119117-1-ref.html
== 1119117-1b.html 1119117-1-ref.html