- Rolling back since I neeed to update some layouttests this change broke.
* fast/forms/cursor-position-expected.txt:
* fast/forms/cursor-position.html:
WebCore:
- Rolling back since I need to update some layouttests this change breaks.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValue):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25186
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-08-22 Kevin McCullough <kmccullough@apple.com>
+
+ - Rolling back since I neeed to update some layouttests this change broke.
+
+ * fast/forms/cursor-position-expected.txt:
+ * fast/forms/cursor-position.html:
+
2007-08-21 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
-This test used to check that the selection start was the same before and after a change to the contents of a textarea.
+This test sets a non-standard line endings, sets selection, then sets a standard line ending string, and checks selection.
-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.
+If this test succeeded, you should see 2 lines saying "10, 10" below.
-Because this would invalidate the previous test, and that the previous test now perfectly shows the new behavior, we repurposed it.
-
-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
+10, 10
+10, 10
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 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>
+ <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>
<hr />
<form>
<textarea id="text"></textarea>
+2007-08-22 Kevin McCullough <kmccullough@apple.com>
+
+ - Rolling back since I need to update some layouttests this change breaks.
+
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::setValue):
+
2007-08-21 Kevin McCullough <kmccullough@apple.com>
Reviewed by Geof, Adam, Hyatt, Maciej and Oliver.
document()->updateRendering();
if (renderer())
renderer()->updateFromElement();
-
- // Set the caret to the end of the text value.
- unsigned endOfString = m_value.length();
- setSelectionRange(endOfString, endOfString);
-
+
+ // 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);
+ }
setChanged();
}