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 : d8fbb70e8745a185142430dc341a5fa0146f5532
This commit is contained in:
Robert O'Callahan 2015-01-11 00:12:33 +13:00
parent 57e3866bff
commit 2eb99aba71
5 changed files with 86 additions and 1 deletions

View File

@ -2020,7 +2020,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.
@ -2136,6 +2136,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

@ -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