Reviewed by Maciej.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Dec 2005 18:23:23 +0000 (18:23 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Dec 2005 18:23:23 +0000 (18:23 +0000)
        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6246
          TextIterator::rangeFromLocationAndLength() returns nil range for an
          empty document

        * editing/input/range-for-empty-document-expected.txt: Added.
        * editing/input/range-for-empty-document.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/editing/input/range-for-empty-document-expected.txt [new file with mode: 0644]
LayoutTests/editing/input/range-for-empty-document.html [new file with mode: 0644]

index b0d125e2d0cce1c956a91fae632e93c8d06ebf22..ab234918957e23be028c5215297470a8ecb255ac 100644 (file)
@@ -1,3 +1,14 @@
+2005-12-28  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Maciej.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6246
+          TextIterator::rangeFromLocationAndLength() returns nil range for an 
+          empty document
+
+        * editing/input/range-for-empty-document-expected.txt: Added.
+        * editing/input/range-for-empty-document.html: Added.
+
 2005-12-27  Maciej Stachowiak  <mjs@apple.com>
 
         Rubber stamped by Eric.
diff --git a/LayoutTests/editing/input/range-for-empty-document-expected.txt b/LayoutTests/editing/input/range-for-empty-document-expected.txt
new file mode 100644 (file)
index 0000000..c2a6616
--- /dev/null
@@ -0,0 +1,4 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+(0, 0): 0,600,0,0
+
+
diff --git a/LayoutTests/editing/input/range-for-empty-document.html b/LayoutTests/editing/input/range-for-empty-document.html
new file mode 100644 (file)
index 0000000..3d37d17
--- /dev/null
@@ -0,0 +1,42 @@
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+</HEAD>
+<BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">
+<script>
+    var console_messages = document.createElement("ol");
+    
+    function log(message)
+    {
+        var item = document.createElement("li");
+        item.appendChild(document.createTextNode(String(message).replace(/0x[0-9a-fA-F]{8}/g, "0xXXXXXXXX").replace(/\n/g, "\\n").replace(/\t/g, "\\t")));
+        console_messages.appendChild(item);
+    }
+    
+    if (window.layoutTestController) {
+        
+        try {
+        
+            layoutTestController.dumpAsText();
+        
+            window.getSelection().setPosition(document.body, 0);
+
+                       // should not be (0, 0, 0, 0)
+            log("(0, 0): " + textInputController.firstRectForCharacterRange(0, 0));
+
+            document.body.innerHTML = "";
+
+        } catch (ex) {
+            log("Exception: " + ex.description);
+        }
+        
+        var console = document.createElement("p");
+        console.appendChild(console_messages);
+        document.body.appendChild(console);
+        
+    } else {
+        document.write("(cannot run interactively)");
+    }
+</script>
+</BODY>
+</HTML>
\ No newline at end of file