2011-01-16 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Jan 2011 18:04:01 +0000 (18:04 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Jan 2011 18:04:01 +0000 (18:04 +0000)
        Reviewed by Dan Bernstein.

        RenderView needs to take transforms on its layer into account
        https://bugs.webkit.org/show_bug.cgi?id=52536

        The RenderView's coordinate mapping methods failed to
        take into account a transform on the RenderView's layer.

        No tests because it's not possible to get a transform
        on the RenderView's layer through content.

        * rendering/RenderView.cpp:
        (WebCore::RenderView::mapLocalToContainer):
        (WebCore::RenderView::mapAbsoluteToLocalPoint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75892 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderView.cpp

index c0428a4044ecfeacb8aca30fe08812d54ab7f607..38141c080b264e4b9ec80740811fa545081e7aa8 100644 (file)
@@ -1,3 +1,20 @@
+2011-01-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        RenderView needs to take transforms on its layer into account
+        https://bugs.webkit.org/show_bug.cgi?id=52536
+        
+        The RenderView's coordinate mapping methods failed to
+        take into account a transform on the RenderView's layer.
+
+        No tests because it's not possible to get a transform
+        on the RenderView's layer through content.
+
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::mapLocalToContainer):
+        (WebCore::RenderView::mapAbsoluteToLocalPoint):
+
 2011-01-15  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r75708.
index 3e4fc777adabd68ed011a0f78868f191b9e0c0d7..44ba4af790796cd64d18dc47022bf84480eba379 100644 (file)
@@ -136,20 +136,32 @@ void RenderView::layout()
     setNeedsLayout(false);
 }
 
-void RenderView::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool /*useTransforms*/, TransformState& transformState) const
+void RenderView::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
 {
     // If a container was specified, and was not 0 or the RenderView,
     // then we should have found it by now.
     ASSERT_UNUSED(repaintContainer, !repaintContainer || repaintContainer == this);
 
+    if (useTransforms && shouldUseTransformFromContainer(0)) {
+        TransformationMatrix t;
+        getTransformFromContainer(0, IntSize(), t);
+        transformState.applyTransform(t);
+    }
+    
     if (fixed && m_frameView)
         transformState.move(m_frameView->scrollOffset());
 }
 
-void RenderView::mapAbsoluteToLocalPoint(bool fixed, bool /*useTransforms*/, TransformState& transformState) const
+void RenderView::mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState& transformState) const
 {
     if (fixed && m_frameView)
         transformState.move(-m_frameView->scrollOffset());
+
+    if (useTransforms && shouldUseTransformFromContainer(0)) {
+        TransformationMatrix t;
+        getTransformFromContainer(0, IntSize(), t);
+        transformState.applyTransform(t);
+    }
 }
 
 void RenderView::paint(PaintInfo& paintInfo, int tx, int ty)