From 9f58ec2444d426dde131da868c3a96a1e2b66f80 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 4 Jan 2012 13:38:57 +1300 Subject: [PATCH] Bug 704469 - Use style context parent instead of frame parent when looking up perspective for 3d transforms. r=roc --- layout/base/nsDisplayList.cpp | 5 ++-- .../transform-3d/overflow-hidden-1-ref.html | 27 +++++++++++++++++++ .../transform-3d/overflow-hidden-1a.html | 27 +++++++++++++++++++ layout/reftests/transform-3d/reftest.list | 1 + 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 layout/reftests/transform-3d/overflow-hidden-1-ref.html create mode 100644 layout/reftests/transform-3d/overflow-hidden-1a.html diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index a3eadf257b24..1c6cc9321f99 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -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 && diff --git a/layout/reftests/transform-3d/overflow-hidden-1-ref.html b/layout/reftests/transform-3d/overflow-hidden-1-ref.html new file mode 100644 index 000000000000..f78592e8db05 --- /dev/null +++ b/layout/reftests/transform-3d/overflow-hidden-1-ref.html @@ -0,0 +1,27 @@ + + + + + + +
+
+
+ diff --git a/layout/reftests/transform-3d/overflow-hidden-1a.html b/layout/reftests/transform-3d/overflow-hidden-1a.html new file mode 100644 index 000000000000..f78592e8db05 --- /dev/null +++ b/layout/reftests/transform-3d/overflow-hidden-1a.html @@ -0,0 +1,27 @@ + + + + + + +
+
+
+ diff --git a/layout/reftests/transform-3d/reftest.list b/layout/reftests/transform-3d/reftest.list index 7ae22556a433..e7b8d1ad3dd0 100644 --- a/layout/reftests/transform-3d/reftest.list +++ b/layout/reftests/transform-3d/reftest.list @@ -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