OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../resources/testharness.js"></script> | |
3 <script src="../../resources/testharnessreport.js"></script> | |
4 <script src="../assert_selection.js"></script> | |
5 <script src="spellcheck_test.js"></script> | |
6 | |
7 <script> | |
8 spellcheck_test( | |
9 '<div contenteditable>|zz. I have a issue.</div>', | |
10 '', | |
11 '<div contenteditable>#zz#. I have ~a~ issue.</div>', | |
12 { | |
13 title: 'Setup for the initial markers.', | |
Xiaocheng
2017/02/01 05:20:28
nit: Could you number the setup test cases?
Manuel Rego
2017/02/01 14:50:25
Sure.
| |
14 callback: sample => spellcheck_test( | |
15 sample, | |
16 document => document.querySelector('div').removeAttribute('contenteditab le'), | |
17 '<div>zz. I have a issue.</div>', | |
18 'Removing "contenteditable" attribute removes spelling markers.') | |
19 }); | |
20 | |
21 spellcheck_test( | |
22 '<div contenteditable>|zz. I have a issue.</div>', | |
23 '', | |
24 '<div contenteditable>#zz#. I have ~a~ issue.</div>', | |
25 { | |
26 title: 'Setup for the initial markers.', | |
27 callback: sample => spellcheck_test( | |
28 sample, | |
29 document => document.querySelector('div').setAttribute('contenteditable' , 'false'), | |
30 '<div contenteditable="false">zz. I have a issue.</div>', | |
31 'Setting "contenteditable" attribute to "false" removes spelling markers .') | |
32 }); | |
33 | |
34 spellcheck_test( | |
35 '<div contenteditable id="parent">zz.<div>|zz.</div>zz.</div>', | |
36 '', | |
37 '<div contenteditable id="parent">#zz#.<div>#zz#.</div>#zz#.</div>', | |
38 { | |
39 title: 'Setup for the initial markers.', | |
40 callback: sample => spellcheck_test( | |
41 sample, | |
42 document => document.getElementById('parent').removeAttribute('contented itable'), | |
43 '<div id="parent">zz.<div>zz.</div>zz.</div>', | |
44 'Removing "contenteditable" attribute from parent removes spelling marke rs.') | |
45 }); | |
46 | |
47 spellcheck_test( | |
48 '<div contenteditable id="parent">zz.<div>|zz.</div>zz.</div>', | |
49 '', | |
50 '<div contenteditable id="parent">#zz#.<div>#zz#.</div>#zz#.</div>', | |
51 { | |
52 title: 'Setup for the initial markers.', | |
53 callback: sample => spellcheck_test( | |
54 sample, | |
55 document => document.getElementById('parent').setAttribute('contentedita ble', 'false'), | |
56 '<div contenteditable="false" id="parent">zz.<div>zz.</div>zz.</div>', | |
57 'Setting "contenteditable" attribute to "false" on parent removes spelli ng markers.') | |
58 }); | |
59 | |
60 spellcheck_test( | |
61 '<div contenteditable>zz.<div id="child">|zz.</div>zz.</div>', | |
62 '', | |
63 '<div contenteditable>#zz#.<div id="child">#zz#.</div>#zz#.</div>', | |
64 { | |
65 title: 'Setup for the initial markers.', | |
66 callback: sample => spellcheck_test( | |
67 sample, | |
68 document => document.getElementById('child').setAttribute('contenteditab le', 'false'), | |
69 '<div contenteditable>#zz#.<div contenteditable="false" id="child">zz.</ div>#zz#.</div>', | |
70 'Setting "contenteditable" attribute to "false" on child removes spellin g markers.') | |
71 }); | |
72 | |
73 spellcheck_test( | |
74 '<div contenteditable id="parent">zz.<div contenteditable>|zz.</div>zz.</div >', | |
75 '', | |
76 '<div contenteditable id="parent">#zz#.<div contenteditable>#zz#.</div>#zz#. </div>', | |
77 { | |
78 title: 'Setup for the initial markers.', | |
79 callback: sample => spellcheck_test( | |
80 sample, | |
81 document => document.getElementById('parent').removeAttribute('contented itable'), | |
82 '<div id="parent">zz.<div contenteditable>#zz#.</div>zz.</div>', | |
83 'Removing "contenteditable" attribute on parent still keeps the spelling markers on child.') | |
84 }); | |
85 | |
86 spellcheck_test( | |
87 '<div contenteditable>zz.<div contenteditable id="child">|zz.</div>zz.</div> ', | |
88 '', | |
89 '<div contenteditable>#zz#.<div contenteditable id="child">#zz#.</div>#zz#.< /div>', | |
90 { | |
91 title: 'Setup for the initial markers.', | |
92 callback: sample => spellcheck_test( | |
93 sample, | |
94 document => document.getElementById('child').removeAttribute('contentedi table'), | |
95 '<div contenteditable>#zz#.<div id="child">#zz#.</div>#zz#.</div>', | |
96 'Removing "contenteditable" attribute on child still keeps the spelling markers.') | |
97 }); | |
98 | |
99 </script> | |
OLD | NEW |