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

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

Issue 1986563002: Apply vertical-align style of <sub> and <sup> to child elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge two test files Created 4 years, 7 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/EditingStyle.h » ('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-04.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04.html b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04.html
new file mode 100644
index 0000000000000000000000000000000000000000..bbd430bf00609939d6b1f5c07e10af9e4726c1b0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04.html
@@ -0,0 +1,40 @@
+<!doctype HTML>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div contenteditable="true">
+<sub><i>1. Make text subscript and italic</i></sub>
+<sup><i>2. Make text superscript and italic</i></sup>
+</div>
+<div id="log"></div>
+<script>
+function test_sub() {
+ document.getSelection().removeAllRanges();
+ var range = document.createRange();
+ range.selectNode(document.querySelector('i'));
+ document.getSelection().addRange(range);
+
+ assert_equals(document.queryCommandState('subscript'), true);
+};
+
+function test_sup() {
+ document.getSelection().removeAllRanges();
+ var range = document.createRange();
+ range.selectNode(document.querySelectorAll('i')[1]);
+ document.getSelection().addRange(range);
+
+ assert_equals(document.queryCommandState('superscript'), true);
+}
+
+test(function() {test_sub()}, "run queryCommandState('subscript')");
+test(function() {test_sup()}, "run queryCommandState('superscript')");
+
+// Test for Mac and Windows behaviors.
+for (const platform of ['mac', 'win']) {
+ if (window.internals)
yosin_UTC9 2016/05/30 06:43:41 nit: How about this? Since, we don't want to write
+ internals.settings.setEditingBehavior(platform);
+ else
+ break;
+ test(function() {test_sub()}, platform + ": run queryCommandState('subscript')");
+ test(function() {test_sup()}, platform + ": run queryCommandState('superscript')");
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698