OLD | NEW |
---|---|
1 <!doctype html> | 1 <!doctype html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <script src="../assert_selection.js"></script> | 4 <script src="../assert_selection.js"></script> |
5 <script> | 5 <script> |
6 test(() => assert_selection( | 6 test(() => assert_selection( |
7 '<div contenteditable>here is <i>some|</i> text</div>', | 7 '<div contenteditable>here is <i>some|</i> text</div>', |
8 selection => { | 8 selection => { |
9 for (var i = 0; i < 5; ++i) | 9 for (var i = 0; i < 5; ++i) |
10 selection.document.execCommand('delete'); | 10 selection.document.execCommand('delete'); |
11 for (var i = 0; i < 4; ++i) | 11 for (var i = 0; i < 4; ++i) |
12 selection.document.execCommand('insertText', false, 'x'); | 12 selection.document.execCommand('insertText', false, 'x'); |
13 }, | 13 }, |
14 '<div contenteditable>here isxxxx|\u{00A0}text</div>'), | 14 '<div contenteditable>here isxxxx|\u{00A0}text</div>'), |
15 'Delete all styled characters and previous character then typing charact er does not keep style'); | |
16 | |
17 test(() => assert_selection( | |
18 '<div contenteditable>here is <i>some|</i> text</div>', | |
19 selection => { | |
20 for (var i = 0; i < 4; ++i) | |
21 selection.document.execCommand('delete'); | |
22 for (var i = 0; i < 4; ++i) | |
23 selection.document.execCommand('insertText', false, 'x'); | |
24 }, | |
25 '<div contenteditable>here is <i>xxxx|</i>\u{00A0}text</div>'), | |
15 'Delete all styled characters then typing character does not keep style' ); | 26 'Delete all styled characters then typing character does not keep style' ); |
Xiaocheng
2016/08/17 06:04:25
The style is kept.
yosin_UTC9
2016/08/17 06:31:18
Fixed description.
| |
16 | 27 |
17 test(() => assert_selection( | 28 test(() => assert_selection( |
18 '<div contenteditable>here is <i>some|</i> text</div>', | 29 '<div contenteditable>here is <i>some|</i> text</div>', |
19 selection => { | 30 selection => { |
20 for (var i = 0; i < 3; ++i) | 31 for (var i = 0; i < 3; ++i) |
21 selection.document.execCommand('delete'); | 32 selection.document.execCommand('delete'); |
22 for (var i = 0; i < 4; ++i) | 33 for (var i = 0; i < 4; ++i) |
23 selection.document.execCommand('insertText', false, 'x'); | 34 selection.document.execCommand('insertText', false, 'x'); |
24 }, | 35 }, |
25 '<div contenteditable>here is <i>sxxxx|</i>\u{00A0}text</div>'), | 36 '<div contenteditable>here is <i>sxxxx|</i>\u{00A0}text</div>'), |
(...skipping 12 matching lines...) Expand all Loading... | |
38 | 49 |
39 selection.document.execCommand('bold'); // disable bold | 50 selection.document.execCommand('bold'); // disable bold |
40 selection.document.execCommand('insertText', false, 'jkl'); | 51 selection.document.execCommand('insertText', false, 'jkl'); |
41 | 52 |
42 selection.document.execCommand('italic'); // disable italic | 53 selection.document.execCommand('italic'); // disable italic |
43 selection.document.execCommand('insertText', false, 'mno'); | 54 selection.document.execCommand('insertText', false, 'mno'); |
44 }, | 55 }, |
45 '<div contenteditable>abc<b>def</b><i><b>ghi</b>jkl</i>mno|</div>'), | 56 '<div contenteditable>abc<b>def</b><i><b>ghi</b>jkl</i>mno|</div>'), |
46 'Nested styles and disabling styles'); | 57 'Nested styles and disabling styles'); |
47 </script> | 58 </script> |
OLD | NEW |