Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html

Issue 2268843002: queryCommandState should consider the nested list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html
new file mode 100644
index 0000000000000000000000000000000000000000..2d43a9454a509a12d0bc64a606d1f36915911888
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-list.html
@@ -0,0 +1,42 @@
+<!doctype HTML>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div>
+ <ol>
+ <li>First list item
+ <ul>
+ <li id="ul_list_item">Nested list item</li>
+ </ul>
+ </li>
+ </ol>
+</div>
+<div>
+ <ul>
+ <li>First list item
+ <ol>
+ <li id="ol_list_item">Nested list item</li>
+ </ol>
+ </li>
+ </ul>
+</div>
+<script>
+test(function() {
+ document.getSelection().removeAllRanges();
+ var range = document.createRange();
+ range.selectNode(document.getElementById('ul_list_item'));
+ document.getSelection().addRange(range);
+
+ assert_equals(document.queryCommandState('insertOrderedList'), false);
+ assert_equals(document.queryCommandState('insertUnorderedList'), true);
+}, 'run queryCommandState() on the unordered list item');
+
+test(function() {
+ document.getSelection().removeAllRanges();
+ var range = document.createRange();
+ range.selectNode(document.getElementById('ol_list_item'));
+ document.getSelection().addRange(range);
+
+ assert_equals(document.queryCommandState('insertOrderedList'), true);
+ assert_equals(document.queryCommandState('insertUnorderedList'), false);
+}, 'run queryCommandState() on the ordered list item');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698