Index: third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-03.html |
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-03.html b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-03.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c5315e48699c862dd9bb275357199c3c0abad7c3 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-03.html |
@@ -0,0 +1,44 @@ |
+<html> |
yosin_UTC9
2016/05/09 03:43:50
Could you use w3c test harness?
Here is an example
|
+<body> |
+This tests queryCommandState. |
+<p> |
+<a href="https://bugs.chromium.org/p/chromium/issues/detail?id=584939">Bug 584939</a> |
+</p> |
+<div contenteditable="true"> |
+<img src="../resources/abe.png"> |
+</div> |
+<ul id="console"></ul> |
+ |
+<script type="text/javascript"> |
+ |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+} |
+ |
+document.getSelection().removeAllRanges(); |
+var range = document.createRange(); |
+range.selectNode(document.querySelector('img')); |
+document.getSelection().addRange(range); |
+ |
+assert(!document.queryCommandState('bold')); |
+assert(!document.queryCommandState('italic')); |
+assert(!document.queryCommandState('underline')); |
+assert(!document.queryCommandState('strikethrough')); |
+ |
+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> |
+ |
+</body> |
+</html> |