From 72ed3d882d55b4e03e95db68975da61b6dfb31e0 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 8 Feb 2012 14:36:16 -0500 Subject: [PATCH] Bug 725426 - Incorrect getBoundingClientRect() for transform-style: flat. r=roc --- layout/base/nsLayoutUtils.cpp | 3 +++ layout/base/tests/Makefile.in | 1 + layout/base/tests/test_bug725426.html | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 layout/base/tests/test_bug725426.html diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 384458b20c4d..cf6670d18ad0 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -1218,6 +1218,9 @@ nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame, nsIFrame *aAncestor) nsIFrame* parent; gfx3DMatrix ctm = aFrame->GetTransformMatrix(aAncestor, &parent); while (parent && parent != aAncestor) { + if (!parent->Preserves3DChildren()) { + ctm.ProjectTo2D(); + } ctm = ctm * parent->GetTransformMatrix(aAncestor, &parent); } return ctm; diff --git a/layout/base/tests/Makefile.in b/layout/base/tests/Makefile.in index d99c96562bd2..4f4ed0fd20b3 100644 --- a/layout/base/tests/Makefile.in +++ b/layout/base/tests/Makefile.in @@ -183,6 +183,7 @@ _TEST_FILES = \ test_bug646757.html \ test_bug718809.html \ test_font_inflation_reftests.html \ + test_bug725426.html \ $(NULL) # Tests for bugs 441782, 467672 and 570378 don't pass reliably on Windows, because of bug 469208 diff --git a/layout/base/tests/test_bug725426.html b/layout/base/tests/test_bug725426.html new file mode 100644 index 000000000000..f02030362741 --- /dev/null +++ b/layout/base/tests/test_bug725426.html @@ -0,0 +1,23 @@ + + +Test for bug 725426 + + + +
+
+
+ +Mozilla Bug 725426 +
+
+