Reviewed by Darin.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Mar 2006 00:57:18 +0000 (00:57 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Mar 2006 00:57:18 +0000 (00:57 +0000)
        <rdar://problem/4427002> REGRESSION: VoiceOver doesn't read heading level text in Safari (Range selectNodeContents broken)

        * editing/deleting/delete-block-merge-contents-022.html: Added.
        * editing/deleting/delete-block-merge-contents-023.html: Added.
        * editing/selection/selectNode-expected.checksum: Added.
        * editing/selection/selectNode-expected.png: Added.
        * editing/selection/selectNode-expected.txt: Added.
        * editing/selection/selectNode.html: Added.
        * editing/selection/selectNodeContents-expected.checksum: Added.
        * editing/selection/selectNodeContents-expected.png: Added.
        * editing/selection/selectNodeContents-expected.txt: Added.
        * editing/selection/selectNodeContents.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/editing/selection/selectNode-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/selectNode-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/selectNode-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/selectNode.html [new file with mode: 0644]
LayoutTests/editing/selection/selectNodeContents-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/selectNodeContents-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/selectNodeContents-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/selectNodeContents.html [new file with mode: 0644]

index 7da986e70bc3a37f9d31825140b4ab4bf598617b..b24b218a475ce65e5a550e44140d79afa5456393 100644 (file)
@@ -1,3 +1,20 @@
+2006-03-27  David Harrison  <harrison@apple.com>
+
+        Reviewed by Darin.
+
+        <rdar://problem/4427002> REGRESSION: VoiceOver doesn't read heading level text in Safari (Range selectNodeContents broken)
+
+        * editing/deleting/delete-block-merge-contents-022.html: Added.
+        * editing/deleting/delete-block-merge-contents-023.html: Added.
+        * editing/selection/selectNode-expected.checksum: Added.
+        * editing/selection/selectNode-expected.png: Added.
+        * editing/selection/selectNode-expected.txt: Added.
+        * editing/selection/selectNode.html: Added.
+        * editing/selection/selectNodeContents-expected.checksum: Added.
+        * editing/selection/selectNodeContents-expected.png: Added.
+        * editing/selection/selectNodeContents-expected.txt: Added.
+        * editing/selection/selectNodeContents.html: Added.
+
 2006-03-27  Alexander Kellett  <lypanov@kde.org>
 
         Reviewed by darin
diff --git a/LayoutTests/editing/selection/selectNode-expected.checksum b/LayoutTests/editing/selection/selectNode-expected.checksum
new file mode 100644 (file)
index 0000000..56ec846
--- /dev/null
@@ -0,0 +1 @@
+93ffe47e0e0836daff8ebe921bb1a6c3
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/selectNode-expected.png b/LayoutTests/editing/selection/selectNode-expected.png
new file mode 100644 (file)
index 0000000..a271437
Binary files /dev/null and b/LayoutTests/editing/selection/selectNode-expected.png differ
diff --git a/LayoutTests/editing/selection/selectNode-expected.txt b/LayoutTests/editing/selection/selectNode-expected.txt
new file mode 100644 (file)
index 0000000..f27ccd8
--- /dev/null
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  RenderCanvas 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 337x18
+          text run at (0,0) width 337: "This tests Range.selectNode() of a text node and a br."
+      RenderBlock {DIV} at (0,34) size 784x18
+        RenderText {TEXT} at (0,0) size 23x18
+          text run at (0,0) width 23: "one"
+      RenderBlock {DIV} at (0,52) size 784x36
+        RenderText {TEXT} at (0,0) size 24x18
+          text run at (0,0) width 24: "two"
+        RenderBR {BR} at (0,0) size 0x0
+        RenderText {TEXT} at (0,18) size 31x18
+          text run at (0,18) width 31: "three"
+      RenderBlock {DIV} at (0,88) size 784x18
+        RenderText {TEXT} at (0,0) size 26x18
+          text run at (0,0) width 26: "four"
+      RenderBlock {UL} at (0,122) size 784x18
+        RenderListItem {LI} at (40,0) size 744x18
+          RenderListMarker at (0,0) size 0x14
+          RenderText {TEXT} at (0,0) size 54x18
+            text run at (0,0) width 54: "Success."
diff --git a/LayoutTests/editing/selection/selectNode.html b/LayoutTests/editing/selection/selectNode.html
new file mode 100644 (file)
index 0000000..9589536
--- /dev/null
@@ -0,0 +1,50 @@
+<script>
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+</script>
+<body>
+<p>This tests Range.selectNode() of a text node and a br.</p>
+<div>one</div>
+<div id=targetParent>two<br>three</div>
+<div>four</div>
+<ul id="console"></ul>
+<script>
+    try {
+       // selectNode of a text node
+               textNode = targetParent.firstChild;
+               range = document.createRange();
+               range.selectNode(textNode);
+               if (range.startContainer != textNode.parentNode)
+                       throw("range.startContainer != textNode.parentNode");
+               if (range.endContainer != textNode.parentNode)
+                       throw("range.endContainer != textNode.parentNode");
+               if (range.startOffset != 0)
+                       throw("Incorrect startOffset in div.");
+               if (range.endOffset != 1)
+                       throw("Incorrect endOffset in div.");
+               if (range.toString() != "two")
+                       throw("Couldn't get the contents of a text node.");
+               
+               brNode = textNode.nextSibling;
+               range.selectNode(brNode);
+               if (range.startContainer != brNode.parentNode)
+                       throw("range.startContainer != brNode.parentNode");
+               if (range.endContainer != brNode.parentNode)
+                       throw("range.endContainer != brNode.parentNode");
+               if (range.startOffset != 1)
+                       throw("Incorrect startOffset in br node.");
+               if (range.endOffset != 2)
+                       throw("Incorrect endOffset in br node.");
+               if (range.toString() != "")
+                       throw("Found br node with non-empty content.");
+
+               log("Success.");
+    } catch(e) {
+        log("Test Failed.  Error was: " + e);
+    }
+</script>
+</body>
diff --git a/LayoutTests/editing/selection/selectNodeContents-expected.checksum b/LayoutTests/editing/selection/selectNodeContents-expected.checksum
new file mode 100644 (file)
index 0000000..fc1c2a4
--- /dev/null
@@ -0,0 +1 @@
+de1ab1cddb22ddaf7ceeafaaa8147923
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/selectNodeContents-expected.png b/LayoutTests/editing/selection/selectNodeContents-expected.png
new file mode 100644 (file)
index 0000000..ce011cd
Binary files /dev/null and b/LayoutTests/editing/selection/selectNodeContents-expected.png differ
diff --git a/LayoutTests/editing/selection/selectNodeContents-expected.txt b/LayoutTests/editing/selection/selectNodeContents-expected.txt
new file mode 100644 (file)
index 0000000..1fc0786
--- /dev/null
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  RenderCanvas 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 393x18
+          text run at (0,0) width 393: "This tests Range.selectNodeContents() of a text node and a br."
+      RenderBlock {DIV} at (0,34) size 784x18
+        RenderText {TEXT} at (0,0) size 23x18
+          text run at (0,0) width 23: "one"
+      RenderBlock {DIV} at (0,52) size 784x36
+        RenderText {TEXT} at (0,0) size 24x18
+          text run at (0,0) width 24: "two"
+        RenderBR {BR} at (0,0) size 0x0
+        RenderText {TEXT} at (0,18) size 31x18
+          text run at (0,18) width 31: "three"
+      RenderBlock {DIV} at (0,88) size 784x18
+        RenderText {TEXT} at (0,0) size 26x18
+          text run at (0,0) width 26: "four"
+      RenderBlock {UL} at (0,122) size 784x18
+        RenderListItem {LI} at (40,0) size 744x18
+          RenderListMarker at (0,0) size 0x14
+          RenderText {TEXT} at (0,0) size 54x18
+            text run at (0,0) width 54: "Success."
diff --git a/LayoutTests/editing/selection/selectNodeContents.html b/LayoutTests/editing/selection/selectNodeContents.html
new file mode 100644 (file)
index 0000000..74207f3
--- /dev/null
@@ -0,0 +1,49 @@
+<script>
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+</script>
+<body>
+<p>This tests Range.selectNodeContents() of a text node and a br.</p>
+<div>one</div>
+<div id=targetParent>two<br>three</div>
+<div>four</div>
+<ul id="console"></ul>
+<script>
+    try {
+               textNode = targetParent.firstChild;
+               range = document.createRange();
+               range.selectNodeContents(textNode);
+               if (range.startContainer != textNode)
+                       throw("range.startContainer != textNode");
+               if (range.endContainer != textNode)
+                       throw("range.endContainer != textNode");
+               if (range.startOffset != 0)
+                       throw("Incorrect startOffset in textNode.");
+               if (range.endOffset != 3)
+                       throw("Incorrect endOffset in textNode.");
+               if (range.toString() != "two")
+                       throw("Couldn't get the contents of a text node.");
+               
+               brNode = textNode.nextSibling;
+               range.selectNodeContents(brNode);
+               if (range.startContainer != brNode)
+                       throw("range.startContainer != brNode");
+               if (range.endContainer != brNode)
+                       throw("range.endContainer != brNode");
+               if (range.startOffset != 0)
+                       throw("Incorrect startOffset in br node.");
+               if (range.endOffset != 0)
+                       throw("Incorrect endOffset in br node.");
+               if (range.toString() != "")
+                       throw("Found br node with non-empty content.");
+               
+               log("Success.");
+    } catch(e) {
+        log("Test Failed.  Error was: " + e);
+    }
+</script>
+</body>