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
Родитель 595ee3fae0
Коммит 528cd97d7a
4 изменённых файлов: 84 добавлений и 1 удалений

Просмотреть файл

@ -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. */

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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