From 528cd97d7a0d4c1e04f5169755bb02462529c9c7 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 27 Apr 2012 12:24:53 +1200 Subject: [PATCH] Bug 740072 - Make perspective-origin check the style parent instead of frame parent. r=roc --- layout/base/nsDisplayList.cpp | 2 +- .../perspective-origin-3-ref.html | 41 +++++++++++++++++++ .../transform-3d/perspective-origin-3a.html | 41 +++++++++++++++++++ layout/reftests/transform-3d/reftest.list | 1 + 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 layout/reftests/transform-3d/perspective-origin-3-ref.html create mode 100644 layout/reftests/transform-3d/perspective-origin-3a.html diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 4ca121dea63..abe35f2f32d 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -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. */ diff --git a/layout/reftests/transform-3d/perspective-origin-3-ref.html b/layout/reftests/transform-3d/perspective-origin-3-ref.html new file mode 100644 index 00000000000..8271d2d3e45 --- /dev/null +++ b/layout/reftests/transform-3d/perspective-origin-3-ref.html @@ -0,0 +1,41 @@ + + + + +
+
+
+
+ + diff --git a/layout/reftests/transform-3d/perspective-origin-3a.html b/layout/reftests/transform-3d/perspective-origin-3a.html new file mode 100644 index 00000000000..345db2c7f15 --- /dev/null +++ b/layout/reftests/transform-3d/perspective-origin-3a.html @@ -0,0 +1,41 @@ + + + + +
+
+
+
+ + diff --git a/layout/reftests/transform-3d/reftest.list b/layout/reftests/transform-3d/reftest.list index 8bbedb3532b..ed3ae1bcbc5 100644 --- a/layout/reftests/transform-3d/reftest.list +++ b/layout/reftests/transform-3d/reftest.list @@ -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