Text selection in text area in auto scroll mode goes wrong.
https://bugs.webkit.org/show_bug.cgi?id=74346

Patch by Sukolsak Sakshuwong <sukolsak@google.com> on 2012-08-14
Reviewed by Ojan Vafai.

Source/WebCore:

WebKit triggers autoscroll in text area when the user drags the cursor from inside
the text area to the outside. When that happens, it gets the local cursor position
relative to the node under the cursor from hit-testing, converts it to
the absolute position, and then converts it to the local position relative to the
text area. However, the hit-testing method of text area did not take scrolling
offset into account. This caused it to give an incorrect value of the local cursor
position. Make the hit-testing take scrolling offset into account.

Test: fast/events/autoscroll-in-textarea.html

* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::createRenderer):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::hitInnerTextElement):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore):
* rendering/RenderTextControlSingleLine.h:
(WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
(WebCore::RenderTextControlInnerBlock::hasLineIfEmpty):

LayoutTests:

* fast/events/autoscroll-in-textarea-expected.txt: Added.
* fast/events/autoscroll-in-textarea.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
8 files changed