Changeset 21448 in webkit


Ignore:
Timestamp:
May 13, 2007 9:45:44 PM (17 years ago)
Author:
ap
Message:

Reviewed by Darin.

http://bugs.webkit.org/show_bug.cgi?id=13690
JavaScript Form Validation issue on Banco do Brasil site

Test: fast/forms/input-setvalue-selection.html

  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setValue): In other browsers, changing textInput.value always moves the insertion point past the text. In 10.4.9 WebKit, this only worked for inactive controls, and it never worked in ToT.
Location:
trunk
Files:
2 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21445 r21448  
     12007-05-13  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=13690
     6        JavaScript Form Validation issue on Banco do Brasil site
     7
     8        * fast/forms/input-setvalue-selection-expected.txt: Added.
     9        * fast/forms/input-setvalue-selection.html: Added.
     10
     11        * fast/forms/input-appearance-maxlength.html: Now that the selection is correctly set
     12        in inactive text inputs, we need to explicitly change it to exercise the same code path.
     13
     14        * fast/forms/input-selection-restore-expected.txt: Removed.
     15        * fast/forms/input-selection-restore.html: Removed.
     16        AFAICT, this test was added in r14931 to test for status quo, and not because we
     17        specifically wanted such behavior.
     18
    1192007-05-13  Rob Buis  <buis@kde.org>
    220
  • trunk/LayoutTests/fast/forms/input-appearance-maxlength.html

    r13567 r21448  
    1818    document.getElementById('sp').value = "123";
    1919   
     20    document.getElementById('sp').setSelectionRange(0, 3);
    2021    document.getElementById('sp').focus();
    2122    document.execCommand("InsertText", false, 'abcd');
  • trunk/WebCore/ChangeLog

    r21447 r21448  
     12007-05-13  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=13690
     6        JavaScript Form Validation issue on Banco do Brasil site
     7
     8        Test: fast/forms/input-setvalue-selection.html
     9
     10        * html/HTMLInputElement.cpp:
     11        (WebCore::HTMLInputElement::setValue): In other browsers, changing textInput.value
     12        always moves the insertion point past the text. In 10.4.9 WebKit, this only worked
     13        for inactive controls, and it never worked in ToT.
     14
    1152007-05-13  Brady Eidson  <beidson@apple.com>
    216
  • trunk/WebCore/html/HTMLInputElement.cpp

    r21447 r21448  
    991991        setAttribute(valueAttr, constrainValue(value));
    992992   
    993     // Restore a caret at the starting point of the old selection.
    994     // This matches Safari 2.0 behavior.
    995     if (isTextField() && document()->focusedNode() == this && cachedSelStart != -1) {
    996         ASSERT(cachedSelEnd != -1);
    997         setSelectionRange(cachedSelStart, cachedSelStart);
     993    if (isTextField()) {
     994        unsigned max = m_value.length();
     995        if (document()->focusedNode() == this)
     996            setSelectionRange(max, max);
     997        else {
     998            cachedSelStart = max;
     999            cachedSelEnd = max;
     1000        }
    9981001    }
    9991002}
Note: See TracChangeset for help on using the changeset viewer.