Changeset 25188 in webkit


Ignore:
Timestamp:
Aug 22, 2007 1:10:40 PM (17 years ago)
Author:
kmccullo
Message:

LayoutTests:

Reviewed by Adele.

  • rdar:5423067 Reapplying the change but only when the text area is in focus.
  • fast/forms/cursor-position-expected.txt:
  • fast/forms/cursor-position.html:

WebCore:

Reviewed by Adele.

  • rdar:5423067 Reapplyingthe change but only when the text area is in focus.
  • html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setValue):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r25186 r25188  
     12007-08-22  Kevin McCullough  <kmccullough@apple.com>
     2
     3        Reviewed by Adele.
     4
     5        - rdar:5423067 Reapplying the change but only when the text area is in focus.
     6
     7        * fast/forms/cursor-position-expected.txt:
     8        * fast/forms/cursor-position.html:
     9
    1102007-08-22  Kevin McCullough  <kmccullough@apple.com>
    211
  • trunk/LayoutTests/fast/forms/cursor-position-expected.txt

    r25186 r25188  
    1 This test sets a non-standard line endings, sets selection, then sets a standard line ending string, and checks selection.
     1This test used to check that the selection start was the same before and after a change to the contents of a textarea.
    22
    3 If this test succeeded, you should see 2 lines saying "10, 10" below.
     3However now, in order to match the behavior of the other major browsers, selection is moved to the end of the text value when a change occurs to the contents of a text area.
     4
     5Because this would invalidate the previous test, and that the previous test now perfectly shows the new behavior, we repurposed it.
    46
    57
    6 10, 10
    7 10, 10
     8rdar://problem/5423067 gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
    89
     10
     1125, 25
     1224, 24
     13
  • trunk/LayoutTests/fast/forms/cursor-position.html

    r25186 r25188  
    1313                    layoutTestController.dumpAsText();
    1414                }
     15
    1516                var elt = document.getElementById("text");
    1617                txt = "this is\ra test\rof cursor";
     
    3637    </head>
    3738    <body onload="test();">
    38         <p>This test sets a non-standard line endings, sets selection, then sets a standard line ending string, and checks selection.</p>
    39         <p>If this test succeeded, you should see 2 lines saying "10, 10" below.</p>
     39        <p>This test used to check that the selection start was the same before and after a change to the contents of a textarea.</p>
     40        <p>However now, in order to match the behavior of the other major browsers, selection is moved to the end of the text value when a change occurs to the contents of a text area.</p>
     41        <p>Because this would invalidate the previous test, and that the previous test now perfectly shows the new behavior, we repurposed it.</p>
     42        <br />
     43        <p>rdar://problem/5423067 gmail is super annoying when trying to add a new name to the TO, CC or BCC fields</p>
    4044        <hr />
    4145        <form>
  • trunk/WebCore/ChangeLog

    r25187 r25188  
     12007-08-22  Kevin McCullough  <kmccullough@apple.com>
     2
     3        Reviewed by Adele.
     4
     5        - rdar:5423067 Reapplyingthe change but only when the text area is in focus.
     6
     7        * html/HTMLTextAreaElement.cpp:
     8        (WebCore::HTMLTextAreaElement::setValue):
     9
    1102007-08-21  David Hyatt  <hyatt@apple.com>
    211
  • trunk/WebCore/html/HTMLTextAreaElement.cpp

    r25186 r25188  
    253253    if (renderer())
    254254        renderer()->updateFromElement();
    255        
    256     // Restore a caret at the starting point of the old selection.
    257     // This matches Safari 2.0 behavior.
    258     if (document()->focusedNode() == this && cachedSelStart != -1) {
    259         ASSERT(cachedSelEnd != -1);
    260         setSelectionRange(cachedSelStart, cachedSelStart);
     255   
     256    // Set the caret to the end of the text value.
     257    if (document()->focusedNode() == this) {
     258        unsigned endOfString = m_value.length();
     259        setSelectionRange(endOfString, endOfString);
    261260    }
     261
    262262    setChanged();
    263263}
Note: See TracChangeset for help on using the changeset viewer.