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

Side by Side 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, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype HTML>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <div contenteditable="true">
5 <sub><i>1. Make text subscript and italic</i></sub>
6 <sup><i>2. Make text superscript and italic</i></sup>
7 </div>
8 <div id="log"></div>
9 <script>
10 function test_sub() {
11 document.getSelection().removeAllRanges();
12 var range = document.createRange();
13 range.selectNode(document.querySelector('i'));
14 document.getSelection().addRange(range);
15
16 assert_equals(document.queryCommandState('subscript'), true);
17 };
18
19 function test_sup() {
20 document.getSelection().removeAllRanges();
21 var range = document.createRange();
22 range.selectNode(document.querySelectorAll('i')[1]);
23 document.getSelection().addRange(range);
24
25 assert_equals(document.queryCommandState('superscript'), true);
26 }
27
28 test(function() {test_sub()}, "run queryCommandState('subscript')");
29 test(function() {test_sup()}, "run queryCommandState('superscript')");
30
31 // Test for Mac and Windows behaviors.
32 for (const platform of ['mac', 'win']) {
33 if (window.internals)
yosin_UTC9 2016/05/30 06:43:41 nit: How about this? Since, we don't want to write
34 internals.settings.setEditingBehavior(platform);
35 else
36 break;
37 test(function() {test_sub()}, platform + ": run queryCommandState('subscript ')");
38 test(function() {test_sup()}, platform + ": run queryCommandState('superscri pt')");
39 }
40 </script>
OLDNEW
« 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