Bug 906199. Ensure that nsDisplayTransforms being bubbled up by preserve-3d have the correct clip applied. r=mattwoodrow

This commit is contained in:
Robert O'Callahan 2013-08-21 15:04:23 +12:00
parent 3e39a45945
commit 8253361b24
4 changed files with 74 additions and 0 deletions

View File

@ -1683,6 +1683,14 @@ WrapPreserve3DListInternal(nsIFrame* aFrame, nsDisplayListBuilder *aBuilder, nsD
if (!aTemp->IsEmpty()) {
aOutput->AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, aFrame, aTemp, aIndex++));
}
// Override item's clipping with our current clip state (if any). Since we're
// bubbling up a preserve-3d transformed child to a preserve-3d parent,
// we can be sure the child doesn't have clip state of its own.
NS_ASSERTION(!item->GetClip().HasClip(), "Unexpected clip on item");
const DisplayItemClip* clip = aBuilder->ClipState().GetCurrentCombinedClip(aBuilder);
if (clip) {
item->SetClip(aBuilder, *clip);
}
aOutput->AppendToTop(item);
break;
}

View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<style>
div {
position:relative;
width:300px;
height:200px;
left:50px;
top:50px;
}
.grandparentdiv {
background:yellow;
overflow:hidden;
}
.childdiv {
background:green;
}
.grandchilddiv {
background:red;
}
</style>
</head>
<body>
<div class="grandparentdiv">
<div class="childdiv">
<div class="grandchilddiv"></div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<style>
div {
position:relative;
width:300px;
height:200px;
left:50px;
top:50px;
transform-style:preserve-3d;
}
.grandparentdiv {
background:yellow;
overflow:hidden;
}
.childdiv {
background:green;
}
.grandchilddiv {
background:red;
}
</style>
</head>
<body>
<div class="grandparentdiv">
<div class="childdiv">
<div class="grandchilddiv"></div>
</div>
</div>
</body>
</html>

View File

@ -1772,3 +1772,4 @@ test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html
== 883987-1f.html 883987-1-ref.html
== 890495-1.html 890495-1-ref.html
== 894931-1.html 894931-1-ref.html
== 906199-1.html 906199-1-ref.html