Bug 704469 - Use style context parent instead of frame parent when looking up perspective for 3d transforms. r=roc

This commit is contained in:
Matt Woodrow 2012-01-04 13:38:57 +13:00
parent 418e53bb8b
commit 3f94d9daf7
4 changed files with 58 additions and 2 deletions

View File

@ -2538,8 +2538,9 @@ nsDisplayTransform::GetResultingTransformMatrix(const nsIFrame* aFrame,
}
const nsStyleDisplay* parentDisp = nsnull;
if (aFrame->GetParent()) {
parentDisp = aFrame->GetParent()->GetStyleDisplay();
nsStyleContext* parentStyleContext = aFrame->GetStyleContext()->GetParent();
if (parentStyleContext) {
parentDisp = parentStyleContext->GetStyleDisplay();
}
if (nsLayoutUtils::Are3DTransformsEnabled() &&
parentDisp && parentDisp->mChildPerspective.GetUnit() == eStyleUnit_Coord &&

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html><head>
<style type="text/css">
.stage{
-moz-perspective: 700px;
overflow: hidden;
width: 260px;
height: 260px;
display: block;
}
.box {
width: 170px;
height: 170px;
background-color: red;
display: block;
-moz-transform: rotate3d(0,1,0, 50deg) translatey(20px);
}
</style>
</head>
<body id="body">
<div class="stage">
<div class="box"></div>
</div>
</body></html>

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html><head>
<style type="text/css">
.stage{
-moz-perspective: 700px;
overflow: hidden;
width: 260px;
height: 260px;
display: block;
}
.box {
width: 170px;
height: 170px;
background-color: red;
display: block;
-moz-transform: rotate3d(0,1,0, 50deg) translatey(20px);
}
</style>
</head>
<body id="body">
<div class="stage">
<div class="box"></div>
</div>
</body></html>

View File

@ -41,3 +41,4 @@ fails == preserve3d-1a.html preserve3d-1-ref.html
== sorting-3a.html green-rect.html
# Different, but equivalent (for the given transform) transform origins
== rotatex-transformorigin-1a.html rotatex-transformorigin-1-ref.html
== overflow-hidden-1a.html overflow-hidden-1-ref.html