Bug 740072 - Make perspective-origin check the style parent instead of frame parent. r=roc

This commit is contained in:
Matt Woodrow 2012-04-27 12:24:53 +12:00
parent e4d5537a7a
commit 3585a9ddba
4 changed files with 84 additions and 1 deletions

View File

@ -2489,7 +2489,7 @@ gfxPoint3D GetDeltaToMozPerspectiveOrigin(const nsIFrame* aFrame,
//TODO: Should this be using our bounds or the parent's bounds?
// How do we handle aBoundsOverride in the latter case?
nsIFrame* parent = aFrame->GetParentStyleContextFrame();
const nsStyleDisplay* display = aFrame->GetParent()->GetStyleDisplay();
const nsStyleDisplay* display = parent->GetStyleDisplay();
nsRect boundingRect = nsDisplayTransform::GetFrameBoundsForTransform(parent);
/* Allows us to access named variables by index. */

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css">
.parentWithPerspective {
-moz-perspective: 100px;
-moz-perspective-origin: 150px 150px;
-webkit-perspective: 100px;
-webkit-perspective-origin: 150px 150px;
/* Changing width/height to 500px should not change the rendering. */
height:100%;
}
.parentWithPerspective > div {
position:absolute;
top:100px;
left:100px;
width:100px;
height:100px;
}
.notTransformed {
outline: 1px solid black;
}
.transformed {
background:blue;
-moz-transform-origin: 0% 0%;
-moz-transform: rotateY(45deg);
-webkit-transform-origin: 0% 0%;
-webkit-transform: rotateY(45deg);
}
</style>
<body>
<div class="parentWithPerspective">
<div class="notTransformed"></div>
<div class="transformed"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css">
.parentWithPerspective {
-moz-perspective: 100px;
-moz-perspective-origin: 150px 150px;
-webkit-perspective: 100px;
-webkit-perspective-origin: 150px 150px;
/* Changing width/height to 500px should not change the rendering. */
height:500px;
}
.parentWithPerspective > div {
position:absolute;
top:100px;
left:100px;
width:100px;
height:100px;
}
.notTransformed {
outline: 1px solid black;
}
.transformed {
background:blue;
-moz-transform-origin: 0% 0%;
-moz-transform: rotateY(45deg);
-webkit-transform-origin: 0% 0%;
-webkit-transform: rotateY(45deg);
}
</style>
<body>
<div class="parentWithPerspective">
<div class="notTransformed"></div>
<div class="transformed"></div>
</div>
</body>
</html>

View File

@ -38,6 +38,7 @@ fuzzy-if(d2d&&layersGPUAccelerated,52,680) fails-if(Android) == scale3d-all-sepa
!= perspective-origin-1a.html rotatex-perspective-1a.html
== perspective-origin-1b.html perspective-origin-1a.html
== perspective-origin-2a.html perspective-origin-2-ref.html
== perspective-origin-3a.html perspective-origin-3-ref.html
!= sorting-1a.html sorting-1-ref.html
# Parallel planes, different z depth
== sorting-2a.html sorting-2-ref.html