"Shadow tree" DOM nodes are being accidentally exposed to JavaScript
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Aug 2009 23:25:57 +0000 (23:25 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Aug 2009 23:25:57 +0000 (23:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=28086

Patch by Darin Adler <darin@apple.com> on 2009-08-07
Reviewed by Adele Peterson.

Rewrite tests that depend on selection inside <input> and <textarea> elements
from showing up with getSelection(), since does not match Firefox and needs to
change soon.

* editing/deleting/delete-ligature-002-expected.txt: Updated.
* editing/deleting/delete-ligature-002.html: Changed to use a contenteditable
<div> element instead of a <textarea> element.

* editing/deleting/delete-ligature-003-expected.txt: Updated.
* editing/deleting/delete-ligature-003.html: Changed to use a contenteditable
<div> element instead of a <textarea> element.

* editing/deleting/skip-virama-001-expected.txt: Updated.
* editing/deleting/skip-virama-001.html: Changed to use a contenteditable
<div> element instead of a <textarea> element.

* editing/input/textarea-arrow-navigation-expected.txt: Moved to fast/forms.
* editing/input/textarea-arrow-navigation.html: Ditto.

* editing/inserting/insert-thai-characters-001-expected.txt: Updated.
* editing/inserting/insert-thai-characters-001.html: Changed to use a contenteditable
<div> element instead of a <textarea> element.

* editing/selection/5213963-expected.txt: Added. This is now a text-only test.
* editing/selection/5213963.html: Added a call to dumpAsText(). Changed selection
testing to use selectionEnd instead of getSelection().type.

* editing/selection/find-in-text-control-expected.txt: Updated.
* editing/selection/find-in-text-control.html: Changed test to distinguish the
different text controls. Made it use activeElement to find out if the selection
is inside a control.

* editing/selection/move-begin-end-expected.txt: Updated.
* editing/selection/move-begin-end.html: Changed to use a contenteditable
<div> element instead of a <textarea> element.

* editing/text-iterator/thai-cursor-movement-expected.txt: Updated.
* editing/text-iterator/thai-cursor-movement.html: Changed to use a contenteditable
<div> element instead of a <textarea> element.

* fast/forms/textarea-arrow-navigation-expected.txt: Moved from editing/input since
this is a <textarea> test, not a general editing test.
* fast/forms/textarea-arrow-navigation.html: Ditto.
Changed to use eventSender instead of the editing machinery to test the down arrow.

* platform/mac/editing/selection/5213963-expected.checksum: Removed.
This is now a text-only test.
* platform/mac/editing/selection/5213963-expected.png: Ditto.
* platform/mac/editing/selection/5213963-expected.txt: Ditto.
* platform/qt/editing/selection/5213963-expected.txt: Ditto.
* platform/win/editing/selection/5213963-expected.txt: Ditto.

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

25 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-ligature-002-expected.txt
LayoutTests/editing/deleting/delete-ligature-002.html
LayoutTests/editing/deleting/delete-ligature-003-expected.txt
LayoutTests/editing/deleting/delete-ligature-003.html
LayoutTests/editing/deleting/skip-virama-001-expected.txt
LayoutTests/editing/deleting/skip-virama-001.html
LayoutTests/editing/input/textarea-arrow-navigation-expected.txt [deleted file]
LayoutTests/editing/inserting/insert-thai-characters-001-expected.txt
LayoutTests/editing/inserting/insert-thai-characters-001.html
LayoutTests/editing/selection/5213963-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/5213963.html
LayoutTests/editing/selection/find-in-text-control-expected.txt
LayoutTests/editing/selection/find-in-text-control.html
LayoutTests/editing/selection/move-begin-end-expected.txt
LayoutTests/editing/selection/move-begin-end.html
LayoutTests/editing/text-iterator/thai-cursor-movement-expected.txt
LayoutTests/editing/text-iterator/thai-cursor-movement.html
LayoutTests/fast/forms/textarea-arrow-navigation-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/textarea-arrow-navigation.html [moved from LayoutTests/editing/input/textarea-arrow-navigation.html with 72% similarity]
LayoutTests/platform/mac/editing/selection/5213963-expected.checksum [deleted file]
LayoutTests/platform/mac/editing/selection/5213963-expected.png [deleted file]
LayoutTests/platform/mac/editing/selection/5213963-expected.txt [deleted file]
LayoutTests/platform/qt/editing/selection/5213963-expected.txt [deleted file]
LayoutTests/platform/win/editing/selection/5213963-expected.txt [deleted file]

index 4c240ec..c6fe2c6 100644 (file)
@@ -1,3 +1,62 @@
+2009-08-07  Darin Adler  <darin@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        "Shadow tree" DOM nodes are being accidentally exposed to JavaScript
+        https://bugs.webkit.org/show_bug.cgi?id=28086
+
+        Rewrite tests that depend on selection inside <input> and <textarea> elements
+        from showing up with getSelection(), since does not match Firefox and needs to
+        change soon.
+
+        * editing/deleting/delete-ligature-002-expected.txt: Updated.
+        * editing/deleting/delete-ligature-002.html: Changed to use a contenteditable
+        <div> element instead of a <textarea> element.
+
+        * editing/deleting/delete-ligature-003-expected.txt: Updated.
+        * editing/deleting/delete-ligature-003.html: Changed to use a contenteditable
+        <div> element instead of a <textarea> element.
+
+        * editing/deleting/skip-virama-001-expected.txt: Updated.
+        * editing/deleting/skip-virama-001.html: Changed to use a contenteditable
+        <div> element instead of a <textarea> element.
+
+        * editing/input/textarea-arrow-navigation-expected.txt: Moved to fast/forms.
+        * editing/input/textarea-arrow-navigation.html: Ditto.
+
+        * editing/inserting/insert-thai-characters-001-expected.txt: Updated.
+        * editing/inserting/insert-thai-characters-001.html: Changed to use a contenteditable
+        <div> element instead of a <textarea> element.
+
+        * editing/selection/5213963-expected.txt: Added. This is now a text-only test.
+        * editing/selection/5213963.html: Added a call to dumpAsText(). Changed selection
+        testing to use selectionEnd instead of getSelection().type.
+
+        * editing/selection/find-in-text-control-expected.txt: Updated.
+        * editing/selection/find-in-text-control.html: Changed test to distinguish the
+        different text controls. Made it use activeElement to find out if the selection
+        is inside a control.
+
+        * editing/selection/move-begin-end-expected.txt: Updated.
+        * editing/selection/move-begin-end.html: Changed to use a contenteditable
+        <div> element instead of a <textarea> element.
+
+        * editing/text-iterator/thai-cursor-movement-expected.txt: Updated.
+        * editing/text-iterator/thai-cursor-movement.html: Changed to use a contenteditable
+        <div> element instead of a <textarea> element.
+
+        * fast/forms/textarea-arrow-navigation-expected.txt: Moved from editing/input since
+        this is a <textarea> test, not a general editing test.
+        * fast/forms/textarea-arrow-navigation.html: Ditto.
+        Changed to use eventSender instead of the editing machinery to test the down arrow.
+
+        * platform/mac/editing/selection/5213963-expected.checksum: Removed.
+        This is now a text-only test.
+        * platform/mac/editing/selection/5213963-expected.png: Ditto.
+        * platform/mac/editing/selection/5213963-expected.txt: Ditto.
+        * platform/qt/editing/selection/5213963-expected.txt: Ditto.
+        * platform/win/editing/selection/5213963-expected.txt: Ditto.
+
 2009-08-07  Drew Wilson  <atwilson@google.com>
 
         Reviewed by David Levin.
index bed7b89..cc0b376 100644 (file)
@@ -1,20 +1,21 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 1 of #text > DIV to 1 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV to 1 of #text > DIV toDOMRange:range from 2 of #text > DIV to 2 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV to 2 of #text > DIV
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV to 1 of #text > DIV toDOMRange:range from 1 of #text > DIV to 1 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 This test tests whether the BackSpace key deletes only the last character of a ligature "วั".
 
 If this test succeeds, you can see "ว" (U+0E27) and a string "succeeded" below.
 
-
+ว
 Succeeded.
index 94e6f6e..377ce23 100644 (file)
         }
         function editingTest() {
             if (window.layoutTestController)
-                window.layoutTestController.dumpAsText();
-            var textarea = document.getElementById("test");
-            textarea.focus();
+                layoutTestController.dumpAsText();
+            var testarea = document.getElementById("test");
+            testarea.focus();
             typeCharacterCommand(String.fromCharCode(0x0E27));
             typeCharacterCommand(String.fromCharCode(0x0E31));
             moveSelectionBackwardByCharacterCommand();
             moveSelectionForwardByCharacterCommand();
             sendBackwardDeleteKey();
-            if (textarea.value == "\u0E27")
+            if (testarea.textContent == "\u0E27")
                 log("Succeeded.");
             else
-                log("Failed. Actual: \"" + textarea.value + "\", Expected: \"\u0E27\"");
+                log("Failed. Actual: \"" + testarea.textContent + "\", Expected: \"\u0E27\"");
         }
         </script>
         <title>Editing Test (Deleting a ligature)</title> 
@@ -33,7 +33,7 @@
     <body>
         <p>This test tests whether the BackSpace key deletes only the last character of a ligature "&#x0E27;&#x0E31;".</p>
         <p>If this test succeeds, you can see "&#x0E27;" (U+0E27) and a string "succeeded" below.</p>
-        <textarea id="test" rows="1" cols="40"></textarea>
+        <div id="test" contenteditable></div>
         <ul id="console"></ul>
         <script language="javascript" type="text/javascript">
         runEditingTest();
index f41675a..33c49cb 100644 (file)
@@ -1,16 +1,17 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV to 2 of #text > DIV
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV to 1 of #text > DIV toDOMRange:range from 1 of #text > DIV to 1 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV to 1 of #text > DIV toDOMRange:range from 1 of #text > DIV to 2 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 This test tests whether the undo command works when the BackSpace key deletes the last character of a ligature "วั".
 
 If this test succeeds, you can see "วั" (U+0E27,U+0E31) and a string "succeeded" below.
 
-
+วั
 Succeeded.
index 2a86d75..4c1160a 100644 (file)
         }
         function editingTest() {
             if (window.layoutTestController)
-                window.layoutTestController.dumpAsText();
-            var textarea = document.getElementById("test");
-            textarea.focus();
+                layoutTestController.dumpAsText();
+            var testarea = document.getElementById("test");
+            testarea.focus();
             moveSelectionForwardByCharacterCommand();
             moveSelectionForwardByCharacterCommand();
             sendBackwardDeleteKey();
             execUndoCommand();
-            if (textarea.value == "\u0E27\u0E31")
+            if (testarea.textContent == "\u0E27\u0E31")
                 log("Succeeded.");
             else
-                log("Failed. Actual: \"" + textarea.value + "\", Expected: \"\u0E27\u0E31\"");
+                log("Failed. Actual: \"" + testarea.value + "\", Expected: \"\u0E27\u0E31\"");
         }
         </script>
         <title>Editing Test (Undo deleting a ligature)</title> 
@@ -32,7 +32,7 @@
     <body>
         <p>This test tests whether the undo command works when the BackSpace key deletes the last character of a ligature "&#x0E27;&#x0E31;".</p>
         <p>If this test succeeds, you can see "&#x0E27;&#x0E31;" (U+0E27,U+0E31) and a string "succeeded" below.</p>
-        <textarea id="test" rows="1" cols="40">&#x0E27;&#x0E31;</textarea>
+        <div id="test" contenteditable>&#x0E27;&#x0E31;</div>
         <ul id="console"></ul>
         <script language="javascript" type="text/javascript">
         runEditingTest();
index 72f7b13..48d1dd3 100644 (file)
@@ -1,12 +1,13 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 1 of #text > DIV to 1 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV to 1 of #text > DIV toDOMRange:range from 2 of #text > DIV to 2 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV to 2 of #text > DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
@@ -14,5 +15,5 @@ This test tests whether or not we can prevent a cursor from moving after a viram
 
 If this test succeeds, you can see a string "succeeded" below.
 
-
+क्ष
 Succeeded.
index 6c117ca..5f3a9d4 100644 (file)
@@ -16,26 +16,26 @@ function sendBackwardDeleteKey() {
 }
 function editingTest() {
     if (window.layoutTestController)
-        window.layoutTestController.dumpAsText();
-    var textarea = document.getElementById("test");
-    textarea.focus();
+        layoutTestController.dumpAsText();
+    var testarea = document.getElementById("test");
+    testarea.focus();
     typeCharacterCommand(String.fromCharCode(0x0915));
     typeCharacterCommand(String.fromCharCode(0x094D));
     typeCharacterCommand(String.fromCharCode(0x0937));
     moveSelectionBackwardByCharacterCommand();
     sendBackwardDeleteKey();
     var expected_result = "\u0915\u094D\u0937";
-    if (textarea.value == expected_result)
+    if (testarea.textContent == expected_result)
         log("Succeeded.");
     else
-        log("Failed. Actual: \"" + textarea.value + "\", Expected: \"" + expected_result + "\".");
+        log("Failed. Actual: \"" + testarea.textContent + "\", Expected: \"" + expected_result + "\".");
 }
 </script>
 </head>
 <body>
 <p>This test tests whether or not we can prevent a cursor from moving after a virama sign.</p>
 <p>If this test succeeds, you can see a string "succeeded" below.</p>
-<textarea id="test" rows="1" cols="40"></textarea>
+<div contenteditable id="test"></div>
 <ul id="console"></ul>
 <script language="javascript" type="text/javascript">
 runEditingTest();
diff --git a/LayoutTests/editing/input/textarea-arrow-navigation-expected.txt b/LayoutTests/editing/input/textarea-arrow-navigation-expected.txt
deleted file mode 100644 (file)
index 7eb7bfc..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-This tests that the cursor doesn't get 'stuck' when advancing through a text area with the down arrow key. See bug #19465 for more information
-
-If the test is successful and the cursor is at the end of the textarea, you should see the word 'Success' printed below
-
-
-Success
index 194cf62..3662e34 100644 (file)
@@ -1,50 +1,51 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV to 0 of DIV toDOMRange:range from 1 of #text > DIV to 1 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV to 1 of #text > DIV toDOMRange:range from 2 of #text > DIV to 2 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV to 2 of #text > DIV toDOMRange:range from 3 of #text > DIV to 3 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV to 3 of #text > DIV toDOMRange:range from 4 of #text > DIV to 4 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV to 4 of #text > DIV toDOMRange:range from 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV to 5 of #text > DIV toDOMRange:range from 6 of #text > DIV to 6 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV to 6 of #text > DIV toDOMRange:range from 7 of #text > DIV to 7 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV to 7 of #text > DIV toDOMRange:range from 8 of #text > DIV to 8 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > BODY > HTML > #document to 8 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV to 8 of #text > DIV toDOMRange:range from 9 of #text > DIV to 9 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > BODY > HTML > #document to 8 of #text > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV to 9 of #text > DIV toDOMRange:range from 10 of #text > DIV to 10 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 10 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV to 10 of #text > DIV toDOMRange:range from 11 of #text > DIV to 11 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > BODY > HTML > #document to 10 of #text > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 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 5 of #text > DIV to 5 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV to 5 of #text > DIV toDOMRange:range from 6 of #text > DIV to 6 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 This test tests whether we can insert a Thai character after a Thai "prepend" character.
 
 If this test succeeds, you can see a string "succeeded" below.
 
-
+อยากไปญี่ปุ่น
 Succeeded.
index 52c2deb..03c6d2c 100644 (file)
@@ -11,9 +11,9 @@ function log(str) {
 }
 function editingTest() {
     if (window.layoutTestController)
-        window.layoutTestController.dumpAsText();
-    var textarea = document.getElementById("test");
-    textarea.focus();
+        layoutTestController.dumpAsText();
+    var testarea = document.getElementById("test");
+    testarea.focus();
     typeCharacterCommand(String.fromCharCode(0x0E2D));
     typeCharacterCommand(String.fromCharCode(0x0E22));
     typeCharacterCommand(String.fromCharCode(0x0E32));
@@ -31,17 +31,17 @@ function editingTest() {
     typeCharacterCommand(String.fromCharCode(0x0E44));
     typeCharacterCommand(String.fromCharCode(0x0E1B));
     var expected_result = "\u0E2D\u0E22\u0E32\u0E01\u0E44\u0E1B\u0E0D\u0E35\u0E48\u0E1B\u0E38\u0E48\u0E19";
-    if (textarea.value == expected_result)
+    if (testarea.textContent == expected_result)
         log("Succeeded.");
      else
-        log("Failed. Actual: \"" + textarea.value + "\", Expected: \"" + expected_result + "\".");
+        log("Failed. Actual: \"" + testarea.textContent.value + "\", Expected: \"" + expected_result + "\".");
 }
 </script>
 </head>
 <body>
 <p>This test tests whether we can insert a Thai character after a Thai "prepend" character.</p>
 <p>If this test succeeds, you can see a string "succeeded" below.</p>
-<textarea id="test" rows="1" cols="40"></textarea>
+<div contenteditable id="test"></div>
 <ul id="console"></ul>
 <script language="javascript" type="text/javascript">
 runEditingTest();
diff --git a/LayoutTests/editing/selection/5213963-expected.txt b/LayoutTests/editing/selection/5213963-expected.txt
new file mode 100644 (file)
index 0000000..1b5a634
--- /dev/null
@@ -0,0 +1,5 @@
+This tests to see that a selection inside an input field is removed when clicking (and focusing) a button in the same frame.
+
+
+
+Success
index 5b0e8ac..83983b2 100644 (file)
@@ -12,19 +12,24 @@ function log(msg) {
     li.appendChild(text);
 }
 
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
 var input = document.getElementById("input");
 input.focus();
 input.setSelectionRange(0, input.value.length);
-if (window.layoutTestController) {
-    if (window.getSelection().type == "None")
-        log("Failure: There was no selection inside the input field when the test began.")
+if (!input.selectionEnd)
+    log("Failure: There was no selection inside the input field when the test began.");
+if (!window.eventSender)
+    log("Test not run because there is no event sender.");
+else {
     var button = document.getElementById("button");
     var x = button.offsetParent.offsetLeft + button.offsetLeft + button.offsetWidth / 2;
     var y = button.offsetParent.offsetTop + button.offsetTop + button.offsetHeight / 2;
     eventSender.mouseMoveTo(x, y);
     eventSender.mouseDown();
     eventSender.mouseUp();
-    if (window.getSelection().type != "None")
-        log("Failure: There was still a selection after clicking a button.")
+    if (!input.selectionEnd)
+        log("Failure: There was still a selection after clicking a button.");
+    log("Success");
 }
-</script>
\ No newline at end of file
+</script>
index f27b93b..82b36f8 100644 (file)
@@ -3,27 +3,27 @@ Test for https://bugs.webkit.org/show_bug.cgi?id=7023 Searching in text areas.
 Lorem ipt amet Lorem ipt amet Lorem ipt amet Lorem ipt amet
 Target m matched at:
     outer text node 1, at offset 9
-    text control, at offset 2
+    textarea, at offset 2
     outer text node 2, at offset 3
     outer text node 2, at offset 15
-    text control, at offset 2
+    input: text, at offset 2
     outer text node 3, at offset 3
     outer text node 3, at offset 15
-    text control, at offset 2
+    input: search, at offset 2
     outer text node 4, at offset 3
     outer text node 4, at offset 15
     outer text node 5, at offset 3
 Target s matched at:
-    text control, at offset 0
-    text control, at offset 10
-    text control, at offset 0
-    text control, at offset 10
-    text control, at offset 0
-    text control, at offset 10
+    textarea, at offset 0
+    textarea, at offset 10
+    input: text, at offset 0
+    input: text, at offset 10
+    input: search, at offset 0
+    input: search, at offset 10
 Target si matched at:
-    text control, at offset 10
-    text control, at offset 10
-    text control, at offset 10
+    textarea, at offset 10
+    input: text, at offset 10
+    input: search, at offset 10
 Target rem matched at:
     outer text node 1, at offset 7
     outer text node 2, at offset 13
index db6789a..75ed906 100644 (file)
@@ -3,9 +3,9 @@
 </p>
 <div id="div">
     Lorem ip<textarea id="textarea">sum dolor si</textarea>t amet
-    Lorem ip<input type="text" value="sum dolor si">t amet
-    Lorem ip<input type="search" value="sum dolor si">t amet
-    Lorem ip<input type="password" value="sum dolor si">t amet
+    Lorem ip<input id="input: text" type="text" value="sum dolor si">t amet
+    Lorem ip<input id="input: search" type="search" value="sum dolor si">t amet
+    Lorem ip<input id="input: password" type="password" value="sum dolor si">t amet
 </div>
 <script>
     if (window.layoutTestController)
 
     var result = "";
 
-    function elementIndex(node)
+    function textNodeIndex(node)
     {
         var index = 1;
         while (node = node.previousSibling) {
-            if (node.nodeType == Node.ELEMENT_NODE)
+            if (node.nodeType == Node.TEXT_NODE)
                 ++index;
         }
         return index;
     }
 
-    function textNodeIndex(node)
+    function clearSelection()
     {
-        var index = 1;
-        while (node = node.previousSibling) {
-            if (node.nodeType == Node.TEXT_NODE)
-                ++index;
-        }
-        return index;
+        getSelection().selectAllChildren(document.body);
+        getSelection().empty();
+    }
+
+    function selectionLocationAsString()
+    {
+        if (document.activeElement.selectionStart != document.activeElement.selectionEnd)
+            return document.activeElement.id + ", at offset " + document.activeElement.selectionStart;
+        if (getSelection().rangeCount == 0)
+            return "";
+        var range = getSelection().getRangeAt(0);
+        return "outer text node " + textNodeIndex(range.startContainer) + ", at offset " + range.startOffset;
     }
 
     function findAll(target)
     {
+        var sel = getSelection();
         var ranges = [];
 
-        var sel = getSelection();
-        sel.empty();
+        clearSelection();
         document.execCommand("FindString", false, target);
-        if (!sel.rangeCount) {
+
+        var firstMatch = selectionLocationAsString();
+        if (firstMatch == "") {
             result += "Target " + target + " not matched\n";
             return;
         }
-        var range = sel.getRangeAt(0);
-        while (!ranges[0] || range.startContainer != ranges[0].startContainer || range.startOffset != ranges[0].startOffset) {
-            ranges.push(range);
+
+        result += "Target " + target + " matched at:\n    " + firstMatch + "\n";
+
+        document.execCommand("FindString", false, target);
+        var match = selectionLocationAsString();
+        while (match !== firstMatch) {
+            result += "    " + match + "\n";
             document.execCommand("FindString", false, target);
-            range = sel.getRangeAt(0);
+            match = selectionLocationAsString();
         }
-        sel.empty();
 
-        var div = document.getElementById("div");
-        result += "Target " + target + " matched at:\n";
-        while (range = ranges.shift()) {
-            result += "    ";
-            result += range.startContainer.parentNode != div ? "text control" : "outer text node " + textNodeIndex(range.startContainer);
-            result += ", at offset " + range.startOffset + "\n";
-        }
+        clearSelection();
     }
 
     findAll("m");
index 19e5a9b..6083af7 100644 (file)
@@ -1,15 +1,19 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 8 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 0 of #text > DIV to 0 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 9 of #text > DIV to 9 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV to 9 of #text > DIV toDOMRange:range from 0 of #text > DIV to 0 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 0 of #text > DIV to 9 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 9 of #text > DIV toDOMRange:range from 9 of #text > DIV to 9 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV to 9 of #text > DIV toDOMRange:range from 0 of #text > DIV to 9 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 9 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+Some text
 This tests that moving the caret and selecting using Command+Left/Right arrows work correctly. If this text is successful, the text "SUCCESS" will be shown below.
 SUCCESS
index 4166cab..f9b2218 100644 (file)
@@ -72,7 +72,7 @@ if (window.layoutTestController)
         </script>
     </head>
     <body onload="runTest();">
-        <textarea id="area">Some text</textarea>
+        <div contenteditable id="area">Some text</textarea>
         <div>This tests that moving the caret and selecting using Command+Left/Right arrows work correctly. If this text is successful, the text "SUCCESS" will be shown below.</div>
         <div id="result">FAILURE</div>
     </body>
index f322fdd..babffb7 100644 (file)
@@ -1,4 +1,5 @@
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 5 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
@@ -14,5 +15,5 @@ Test that moving insertion point over Thai text (without ligatures) always moves
 
 Should say PASS:
 
-
+อยากไปความ
 PASS
index 3ce4aa2..9483f92 100644 (file)
@@ -14,14 +14,14 @@ function log(str)
 function editingTest()
 {
     if (window.layoutTestController)
-        window.layoutTestController.dumpAsText();
-    var textarea = document.getElementById("test");
-    textarea.focus();
+        layoutTestController.dumpAsText();
+    var editableArea = document.getElementById("test");
+    editableArea.focus();
 
     var i = 1;
-    for (; i <= textarea.textContent.length; ++i) {
+    for (; i <= editableArea.firstChild.data.length; ++i) {
         moveSelectionForwardByCharacterCommand();
-        if (window.getSelection().baseOffset != i) {
+        if (getSelection().baseOffset != i) {
             log("FAIL: " + i);
             return;
         }
@@ -34,7 +34,7 @@ function editingTest()
 <body>
 <p>Test that moving insertion point over Thai text (without ligatures) always moves one character at a time.</p>
 <p>Should say PASS:</p>
-<textarea id="test" rows="1" cols="40">อยากไปความ</textarea>
+<div contenteditable id="test">อยากไปความ</textarea>
 <ul id="console"></ul>
 <script language="javascript" type="text/javascript">
 runEditingTest();
diff --git a/LayoutTests/fast/forms/textarea-arrow-navigation-expected.txt b/LayoutTests/fast/forms/textarea-arrow-navigation-expected.txt
new file mode 100644 (file)
index 0000000..f7268e0
--- /dev/null
@@ -0,0 +1,6 @@
+This tests that the cursor doesn't get 'stuck' when advancing through a text area with the down arrow key. See bug #19465 for more information
+
+If the test is successful and the cursor is at the end of the textarea, you should see the word 'Success' printed below
+
+
+Success
@@ -1,19 +1,22 @@
 <html>
 <head>
-<link rel=stylesheet href="../editingStyle.css" type="text/css">
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
 <script>
 
-function log(str) {
+function log(str)
+{
     var li = document.createElement("li");
     li.appendChild(document.createTextNode(str));
     var console = document.getElementById("console");
     console.appendChild(li);
 }
 
-function editingTest() {
+function runTest()
+{
     if (window.layoutTestController)
-        window.layoutTestController.dumpAsText();
+        layoutTestController.dumpAsText();
+
+    if (!window.eventSender)
+        return;
 
     var textarea = document.getElementById("test");
 
@@ -22,12 +25,11 @@ function editingTest() {
     // numbered lines:
     textarea.setSelectionRange(5, 5);
     for (var i = 0; i < 10; i++) {
-        // press the 'down arrow' a bunch of times to try to get to the end of
-        // the text area
-        moveSelectionForwardByLineCommand();
+        // press the 'down arrow' a bunch of times to try to get to the end of the text area
+        eventSender.keyDown("downArrow");
     }
     if (textarea.selectionStart != textarea.value.length)
-        log ("Fail.  Expected: selectionStart == " + textarea.value.length + ", Found: " + textarea.selectionStart);
+        log("Fail.  Expected: selectionStart == " + textarea.value.length + ", Found: " + textarea.selectionStart);
     else
         log("Success");
 }
@@ -35,7 +37,7 @@ function editingTest() {
 </script>
 
 </head>
-    <body>
+    <body onload="runTest()">
         <p>
         This tests that the cursor doesn't get 'stuck' when advancing through a
         text area with the down arrow key.  See bug #19465 for more information
@@ -51,9 +53,6 @@ function editingTest() {
 What is the expected output? What do you see instead?</textarea>
 
 <ul id="console"></ul>
-<script>
-runEditingTest();
-</script>
 
     </body>
 </html>
diff --git a/LayoutTests/platform/mac/editing/selection/5213963-expected.checksum b/LayoutTests/platform/mac/editing/selection/5213963-expected.checksum
deleted file mode 100644 (file)
index f6df509..0000000
+++ /dev/null
@@ -1 +0,0 @@
-889478b6d51053f1088cc0045977fb3c
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/editing/selection/5213963-expected.png b/LayoutTests/platform/mac/editing/selection/5213963-expected.png
deleted file mode 100644 (file)
index 0423edd..0000000
Binary files a/LayoutTests/platform/mac/editing/selection/5213963-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/editing/selection/5213963-expected.txt b/LayoutTests/platform/mac/editing/selection/5213963-expected.txt
deleted file mode 100644 (file)
index dae4aca..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x576
-      RenderBlock {P} at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 759x18
-          text run at (0,0) width 759: "This tests to see that a selection inside an input field is removed when clicking (and focusing) a button in the same frame."
-      RenderBlock (anonymous) at (0,34) size 784x45
-        RenderTextControl {INPUT} at (2,2) size 344x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-        RenderBR {BR} at (348,16) size 0x0
-        RenderButton {INPUT} at (2,25) size 62x18 [bgcolor=#C0C0C0]
-          RenderBlock (anonymous) at (8,2) size 46x13
-            RenderText at (0,0) size 46x13
-              text run at (0,0) width 46: "Click Me"
-        RenderBR {BR} at (66,38) size 0x0
-      RenderBlock {UL} at (0,95) size 784x0
-layer at (13,47) size 338x13 scrollWidth 374
-  RenderBlock {DIV} at (3,3) size 338x13
-    RenderText {#text} at (1,0) size 372x13
-      text run at (1,0) width 372: "After you click the button below, this content should not be selected."
diff --git a/LayoutTests/platform/qt/editing/selection/5213963-expected.txt b/LayoutTests/platform/qt/editing/selection/5213963-expected.txt
deleted file mode 100644 (file)
index 531df08..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x578
-      RenderBlock {P} at (0,0) size 784x19
-        RenderText {#text} at (0,0) size 766x19
-          text run at (0,0) width 766: "This tests to see that a selection inside an input field is removed when clicking (and focusing) a button in the same frame."
-      RenderBlock (anonymous) at (0,33) size 784x61
-        RenderTextControl {INPUT} at (2,2) size 488x25 [border: (2px inset #000000)]
-        RenderBR {BR} at (492,19) size 0x0
-        RenderButton {INPUT} at (2,31) size 59x28 [bgcolor=#C0C0C0]
-          RenderBlock (anonymous) at (6,6) size 47x17
-            RenderText at (0,0) size 47x17
-              text run at (0,0) width 47: "Click Me"
-        RenderBR {BR} at (63,49) size 0x0
-      RenderBlock {UL} at (0,108) size 784x0
-layer at (13,46) size 482x19
-  RenderBlock {DIV} at (3,3) size 482x19
-    RenderText {#text} at (1,0) size 429x19
-      text run at (1,0) width 429: "After you click the button below, this content should not be selected."
diff --git a/LayoutTests/platform/win/editing/selection/5213963-expected.txt b/LayoutTests/platform/win/editing/selection/5213963-expected.txt
deleted file mode 100644 (file)
index 7787fe8..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x576
-      RenderBlock {P} at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 759x18
-          text run at (0,0) width 759: "This tests to see that a selection inside an input field is removed when clicking (and focusing) a button in the same frame."
-      RenderBlock (anonymous) at (0,34) size 784x45
-        RenderTextControl {INPUT} at (2,2) size 430x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-        RenderBR {BR} at (434,16) size 0x0
-        RenderButton {INPUT} at (2,25) size 62x18 [bgcolor=#C0C0C0]
-          RenderBlock (anonymous) at (8,2) size 46x13
-            RenderText at (0,0) size 46x13
-              text run at (0,0) width 46: "Click Me"
-        RenderBR {BR} at (66,38) size 0x0
-      RenderBlock {UL} at (0,95) size 784x0
-layer at (13,47) size 424x13
-  RenderBlock {DIV} at (3,3) size 424x13
-    RenderText {#text} at (1,0) size 372x13
-      text run at (1,0) width 372: "After you click the button below, this content should not be selected."