Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
- 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 instead of remembering the location of the selection.
- <rdar://problem/
5423067> gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
* fast/forms/cursor-position-expected.txt:
* fast/forms/cursor-position.html:
WebCore:
Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
- 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 instead of remembering the location of the selection.
- <rdar://problem/
5423067> gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValue):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25185
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-08-21 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
+
+ - 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 instead of remembering the location of the selection.
+ - <rdar://problem/5423067> gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
+
+ * fast/forms/cursor-position-expected.txt:
+ * fast/forms/cursor-position.html:
+
2007-08-21 Adam Roben <aroben@apple.com>
* platform/win/Skipped: Added a couple more failures.
-This test sets a non-standard line endings, sets selection, then sets a standard line ending string, and checks selection.
+This test used to check that the selection start was the same before and after a change to the contents of a textarea.
-If this test succeeded, you should see 2 lines saying "10, 10" below.
+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.
+Because this would invalidate the previous test, and that the previous test now perfectly shows the new behavior, we repurposed it.
-10, 10
-10, 10
+
+rdar://problem/5423067 gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
+
+
+25, 25
+24, 24
if (window.layoutTestController) {
layoutTestController.dumpAsText();
}
+
var elt = document.getElementById("text");
txt = "this is\ra test\rof cursor";
txt2 = "this is\na test\nof cursor!";
</script>
</head>
<body onload="test();">
- <p>This test sets a non-standard line endings, sets selection, then sets a standard line ending string, and checks selection.</p>
- <p>If this test succeeded, you should see 2 lines saying "10, 10" below.</p>
+ <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>
+ <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>
+ <p>Because this would invalidate the previous test, and that the previous test now perfectly shows the new behavior, we repurposed it.</p>
+ <br />
+ <p>rdar://problem/5423067 gmail is super annoying when trying to add a new name to the TO, CC or BCC fields</p>
<hr />
<form>
<textarea id="text"></textarea>
+2007-08-21 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
+
+ - 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 instead of remembering the location of the selection.
+ - <rdar://problem/5423067> gmail is super annoying when trying to add a new name to the TO, CC or BCC fields
+
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::setValue):
+
2007-08-21 Adam Roben <aroben@apple.com>
Build fix for Mac
document()->updateRendering();
if (renderer())
renderer()->updateFromElement();
-
- // Restore a caret at the starting point of the old selection.
- // This matches Safari 2.0 behavior.
- if (document()->focusedNode() == this && cachedSelStart != -1) {
- ASSERT(cachedSelEnd != -1);
- setSelectionRange(cachedSelStart, cachedSelStart);
- }
+
+ // Set the caret to the end of the text value.
+ unsigned endOfString = m_value.length();
+ setSelectionRange(endOfString, endOfString);
+
setChanged();
}