Fix scrollRectToVisible in the presence of transforms
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2013 21:44:25 +0000 (21:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2013 21:44:25 +0000 (21:44 +0000)
commitad96fbad9bb09c83c6851e5f16390703809100e2
tree0a2fdca4656893387c1ccacf7e3880af7b11e96d
parent6b0c320dd47fd2fd76cc387e3b55550e5ead7690
Fix scrollRectToVisible in the presence of transforms
https://bugs.webkit.org/show_bug.cgi?id=105574

Patch by Chris Hopman <cjhopman@google.com> on 2013-01-18
Reviewed by Simon Fraser.

Source/WebCore:

When scrolling to reveal an overflow layer, the required scroll was
being calculated in absolute coordinates. To properly account for
transforms, this calculation should be done in the local coordinates
of the renderBox.

Tests: editing/input/reveal-selection-transformed-overflow-parent.html
       editing/input/reveal-selection-transformed-textarea.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
When scrolling to reveal an overflow layer, calculate the required
scroll in the local coordinates of the RenderBox.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::absoluteToLocalQuad):
(WebCore):
* rendering/RenderObject.h:
(RenderObject):
Add function to convert an absolute quad to a local quad.

LayoutTests:

* editing/input/reveal-caret-of-transformed-input-scrollable-parent.html: Added.
* editing/input/reveal-caret-of-transformed-input-scrollable-parent-expected.txt: Added.
Test that when scrolling an overflow layer to reveal a rect, the rect
passed to the parent to scroll is calculated properly.
* editing/input/reveal-caret-of-transformed-multiline-input.html: Added.
* editing/input/reveal-caret-of-transformed-multiline-input-expected.txt: Added.
Test that scrolling to reveal a rect works properly on a transformed
overflow layer.

* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/input/reveal-caret-of-transformed-input-scrollable-parent-expected.txt [new file with mode: 0644]
LayoutTests/editing/input/reveal-caret-of-transformed-input-scrollable-parent.html [new file with mode: 0644]
LayoutTests/editing/input/reveal-caret-of-transformed-multiline-input-expected.txt [new file with mode: 0644]
LayoutTests/editing/input/reveal-caret-of-transformed-multiline-input.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h