2011-01-12 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 04:51:16 +0000 (04:51 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 04:51:16 +0000 (04:51 +0000)
commit67f3f3d73dbc4d565bb4f87d733413fd7b7bc8a5
treee55c8be275ea090bb832efc93207410c59a9cc66
parente9d5945668b8798aabb8814af907bc4dc271741f
2011-01-12  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        REGRESSION(r69831): focus() in onkeypress discards input (affects chaseonline.chase.com)
        https://bugs.webkit.org/show_bug.cgi?id=52241

        The bug was caused by RenderTextControl::selection's creating a Range with m_insertText
        which is a shadow DOM div as both start and end containers. Fixed the bug by traversing
        through the descendents of m_innerText and using the right start and end containers to
        create a Range.

        Test: fast/forms/focus-change-on-keypress.html

        * rendering/RenderTextControl.cpp:
        (WebCore::setContainerAndOffsetForRange): Added; a helper function.
        (WebCore::RenderTextControl::selection): See above.
2011-01-12  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        REGRESSION(r69831): focus() in onkeypress discards input (affects chaseonline.chase.com)
        https://bugs.webkit.org/show_bug.cgi?id=52241

        Added a test to ensure WebKit inserts the character typed by a user when focus's node
        is changed by a presskey event handler.

        * fast/forms/focus-change-on-keypress-expected.txt: Added.
        * fast/forms/focus-change-on-keypress.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/focus-change-on-keypress-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/focus-change-on-keypress.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTextControl.cpp