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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/queryCommandState-04-mac.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: add test cases for Mac 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
OLDNEW
(Empty)
1 <!doctype HTML>
yosin_UTC9 2016/05/30 01:28:11 Could you integrate this test into CommandState-04
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(platform) {
11 internals.settings.setEditingBehavior(platform);
12
13 document.getSelection().removeAllRanges();
14 var range = document.createRange();
15 range.selectNode(document.querySelector('i'));
16 document.getSelection().addRange(range);
17
18 assert_equals(document.queryCommandState('subscript'), true);
19 };
20
21 function test_sup(platform) {
22 internals.settings.setEditingBehavior(platform);
23
24 document.getSelection().removeAllRanges();
25 var range = document.createRange();
26 range.selectNode(document.querySelectorAll('i')[1]);
27 document.getSelection().addRange(range);
28
29 assert_equals(document.queryCommandState('superscript'), true);
30 }
31
32 if (window.internals) {
33 test(function(){test_sub('win')}, 'Windows behavior');
34 test(function(){test_sup('win')}, 'Windows behavior');
35 test(function(){test_sub('mac')}, 'Mac behavior');
36 test(function(){test_sup('mac')}, 'Mac behavior');
37
38 var isMac = navigator.platform.indexOf('Mac') == 0;
39 if (isMac) {
40 test(function(){test_sub('mac')}, 'Mac behavior on Mac');
41 test(function(){test_sup('mac')}, 'Mac behavior on Mac');
42 }
43 }
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698