git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17235 268f45cc-cd09-0410...
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2006 02:36:47 +0000 (02:36 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2006 02:36:47 +0000 (02:36 +0000)
LayoutTests/editing/execCommand/queryCommandState-01-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/queryCommandState-01.html [new file with mode: 0644]

diff --git a/LayoutTests/editing/execCommand/queryCommandState-01-expected.txt b/LayoutTests/editing/execCommand/queryCommandState-01-expected.txt
new file mode 100644 (file)
index 0000000..013660b
--- /dev/null
@@ -0,0 +1,25 @@
+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: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > UL > DIV > BODY > HTML > #document to 0 of LI > UL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) 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: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > OL > DIV > BODY > HTML > #document to 0 of LI > OL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+This tests queryCommandState for InsertUnorderedList and InsertOrderedList.
+
+foo
+Success
+Success
+Success
+Success
+Success
+Success
+
diff --git a/LayoutTests/editing/execCommand/queryCommandState-01.html b/LayoutTests/editing/execCommand/queryCommandState-01.html
new file mode 100644 (file)
index 0000000..f4a548f
--- /dev/null
@@ -0,0 +1,39 @@
+<head>
+<script>
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+
+function assert(bool) {
+    if (!bool)
+        log("Failure");
+    else
+        log("Success");
+}
+</script>
+</head>
+<body>
+<p>This tests queryCommandState for InsertUnorderedList and InsertOrderedList.</p>
+<div id="div" contenteditable="true">foo</div>
+<ol id="console"></ol>
+<script>
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+var sel = window.getSelection();
+var div = document.getElementById("div");
+sel.setPosition(div, 0);
+
+assert(!document.queryCommandState("InsertUnorderedList"));
+assert(!document.queryCommandState("InsertOrderedList"));
+document.execCommand("InsertUnorderedList");
+assert(document.queryCommandState("InsertUnorderedList"));
+assert(!document.queryCommandState("InsertOrderedList"));
+document.execCommand("InsertUnorderedList");
+document.execCommand("InsertOrderedList");
+assert(!document.queryCommandState("InsertUnorderedList"));
+assert(document.queryCommandState("InsertOrderedList"));
+</script>
+</body>