LayoutTests:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2006 21:40:04 +0000 (21:40 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Aug 2006 21:40:04 +0000 (21:40 +0000)
        Reviewed by Maciej.

        Test for: <rdar://problem/4680207> REGRESSION: select-all should fire onSelect event for text fields and textareas (9518)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=9518

        * fast/forms/onselect-selectall-expected.txt: Added.
        * fast/forms/onselect-selectall.html: Added.

WebCore:

        Reviewed by Maciej.

        - Fix for <rdar://problem/4680207> REGRESSION: select-all should fire onSelect event for text fields and textareas (9518)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=9518

        Test: fast/forms/onselect-selectall.html

        * page/Frame.cpp: (WebCore::Frame::selectAll): Call notifyRendererOfSelectionChange with userTriggered = true so that onSelect will fire.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15886 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/onselect-selectall-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/onselect-selectall.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/Frame.cpp

index 865a46625b162ffb84f7639bf56c742767d12199..16d975b526ebf5ca22c36063332eb184021ce3c7 100644 (file)
@@ -1,3 +1,13 @@
+2006-08-15  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Maciej.
+
+        Test for: <rdar://problem/4680207> REGRESSION: select-all should fire onSelect event for text fields and textareas (9518)
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9518
+
+        * fast/forms/onselect-selectall-expected.txt: Added.
+        * fast/forms/onselect-selectall.html: Added.
+
 2006-08-14  Eric Seidel  <eric@eseidel.com>
 
         Reviewed by mjs.
diff --git a/LayoutTests/fast/forms/onselect-selectall-expected.txt b/LayoutTests/fast/forms/onselect-selectall-expected.txt
new file mode 100644 (file)
index 0000000..a25fc26
--- /dev/null
@@ -0,0 +1,12 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 4 of #text > DIV toDOMRange:range from 0 of #text > DIV to 4 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV to 4 of #text > DIV toDOMRange:range from 0 of #text > DIV to 4 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+This tests that onSelect will fire for textfields and textareas when select-all is invoked.
+
+
+Test Passed: textfield
+Test Passed: textarea
+
diff --git a/LayoutTests/fast/forms/onselect-selectall.html b/LayoutTests/fast/forms/onselect-selectall.html
new file mode 100644 (file)
index 0000000..93dc297
--- /dev/null
@@ -0,0 +1,28 @@
+<html>
+<head>
+<script src="../../editing/editing.js"></script>
+<script>
+function test() {
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+    }
+    document.getElementById('tf').focus();
+    selectAllCommand();    
+    document.getElementById('ta').focus();
+    selectAllCommand();
+}
+
+function log(msg) {
+    document.getElementById('res').innerHTML = document.getElementById('res').innerHTML + msg + "<br>";
+}
+
+</script>
+</head>
+<body onload="test()">
+This tests that onSelect will fire for textfields and textareas when select-all is invoked.<br/>
+<input id="tf" value="test" onSelect="log('Test Passed: textfield')"><br/>
+<textarea id="ta" onSelect="log('Test Passed: textarea')">test</textarea><br/>
+
+<div id="res"></div>
+</body>
+</html>
\ No newline at end of file
index 1f0e52b36317b547ee082c5d426558dd73a04cd9..041c03a966b5bac341212183852748570b537b9d 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-15  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Maciej.
+
+        - Fix for <rdar://problem/4680207> REGRESSION: select-all should fire onSelect event for text fields and textareas (9518)
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9518
+
+        Test: fast/forms/onselect-selectall.html
+
+        * page/Frame.cpp: (WebCore::Frame::selectAll): Call notifyRendererOfSelectionChange with userTriggered = true so that onSelect will fire.
+
 2006-08-15  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Darin.
index b53bc6c2bb3bf9dad7c8cdaadd9dd44d0b51cd2f..22c8d4c8226967b61e4ea74b47133dfd07efb558 100644 (file)
@@ -1964,6 +1964,7 @@ void Frame::selectAll()
     
     selectContentsOfNode(root);
     selectFrameElementInParentIfFullySelected();
+    notifyRendererOfSelectionChange(true);
 }
 
 bool Frame::selectContentsOfNode(Node* node)