2010-11-11  Julie-Jeongeun-Kim  <jiyuluna@gmail.com>

        Reviewed by Kent Tamura.

        SelectionStart, selectionEnd properties return wrong values when the selection is in a read-only input or textarea element
        https://bugs.webkit.org/show_bug.cgi?id=25444

        * fast/forms/selection-start-end-readonly-expected.txt: Added.
        * fast/forms/selection-start-end-readonly.html: Added.
2010-11-11  Julie-Jeongeun-Kim  <jiyuluna@gmail.com>

        Reviewed by Kent Tamura.

        SelectionStart, selectionEnd properties return wrong values when the selection is in a read-only input or textarea element
        https://bugs.webkit.org/show_bug.cgi?id=25444

        'rootEditableElement()' is checked on RenderTextControl::indexForVisiblePosition.
        It means that just editable elements can get selection information.
        ReadOnly element is not editable element. So, it just returns and can't get correct selection information.
        INPUT and TEXTAREA elements can be read-only but 'indexForVisiblePosition' doesn't accept them.
        So, Selectable elements, INPUT and TEXTAREA, checking is added for that case.
        Even if they are read-only, they are selectable.

        new tests:fast/forms/selection-start-end-readonly.html

        * html/HTMLInputElement.idl:
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::isSelectableElement):
        (WebCore::RenderTextControl::indexForVisiblePosition):
        * rendering/RenderTextControl.h:

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