2011-04-15 Alice Boxhall <aboxhall@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2011 13:44:54 +0000 (13:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2011 13:44:54 +0000 (13:44 +0000)
commit3312ed311b53e34eafbe27d86b43f02fddddcaa8
tree9230eae6996bc3c6c4010b7873c1e5b2ae68ff5a
parent1f0b7650f2005de92bd44329be7e76373f0d3ca4
2011-04-15  Alice Boxhall  <aboxhall@chromium.org>

        Reviewed by Ryosuke Niwa.

        Text selection changes unexpectedly when dragging out of the <input>
        https://bugs.webkit.org/show_bug.cgi?id=55552

        Tests that dragging outside of a contenteditable, input or textarea selects to the end of the
        element, rather than jumping back to the beginning.

        * editing/selection/resources/select-out-of-floated-editable.js: Added.
        (log):
        (else.window.onmouseup):
        (getSelectionStart):
        (getSelectionEnd):
        (checkSelection):
        * editing/selection/select-out-of-editable-expected.txt: Added.
        * editing/selection/select-out-of-editable.html: Added.
        * editing/selection/select-out-of-floated-contenteditable-expected.txt: Added.
        * editing/selection/select-out-of-floated-contenteditable.html: Added.
        * editing/selection/select-out-of-floated-input-expected.txt: Added.
        * editing/selection/select-out-of-floated-input.html: Added.
        * editing/selection/select-out-of-floated-textarea-expected.txt: Added.
        * editing/selection/select-out-of-floated-textarea.html: Added.
2011-04-15  Alice Boxhall  <aboxhall@chromium.org>

        Reviewed by Ryosuke Niwa.

        Text selection changes unexpectedly when dragging out of the <input>
        https://bugs.webkit.org/show_bug.cgi?id=55552

        Tests: editing/selection/select-out-of-editable.html
               editing/selection/select-out-of-floated-contenteditable.html
               editing/selection/select-out-of-floated-input.html
               editing/selection/select-out-of-floated-textarea.html

        * page/EventHandler.cpp:
        (WebCore::selectionExtentRespectingEditingBoundary): When dragging from an editable element, check that
        the endpoint is not outside the element. If it is, translate the point into a local point within
        the editable element.
        (WebCore::EventHandler::updateSelectionForMouseDrag): Call targetPositionForSelectionEndpoint() to
        calculate the selection endpoint.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/selection/resources/select-out-of-floated-editable.js [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-editable-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-editable.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-contenteditable-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-contenteditable.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-input-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-input.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-textarea-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-textarea.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp