OLD | NEW |
---|---|
(Empty) | |
1 <script src="../../resources/testharness.js"></script> | |
2 <div contenteditable id="root" class="editing"> | |
3 <span id="test"></span> | |
4 </div> | |
5 <pre id="output"> | |
yosin_UTC9
2016/04/30 03:16:17
nit: Pleas use <div id="log"></div>, if so you don
chrishtr
2016/04/30 21:56:30
Done.
| |
6 <pre> | |
7 <script> | |
8 if (window.testRunner) | |
yosin_UTC9
2016/04/30 03:16:16
You don't need to have this if-statement, w3c test
chrishtr
2016/04/30 21:56:30
Done.
| |
9 window.testRunner.dumpAsText(); | |
10 | |
11 test(function editingTest() { | |
yosin_UTC9
2016/04/30 03:16:17
s/test(function editingTest() {/test(function() {/
| |
12 // The innerText must be set explicitly, and not with an editing command . | |
13 root.innerText = "1"; | |
14 window.getSelection().collapse(root.firstChild, 1); | |
15 | |
16 if (window.internals) | |
17 window.internals.startTrackingRepaints(document); | |
18 | |
19 document.execCommand('delete'); | |
20 | |
21 if (window.internals) { | |
22 var layers = JSON.parse(window.internals.layerTreeAsText(documen t, internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS)); | |
23 assert_true(layers.children[0].paintInvalidations[2].reason == " invalidate paint rectangle"); | |
yosin_UTC9
2016/04/30 03:16:17
Please use assert_equal(actual, expected, [descrip
| |
24 // Check that thet x offset is 22. This for the caret rect befor e delete. | |
25 assert_true(layers.children[0].paintInvalidations[2].rect[3] == 22); | |
yosin_UTC9
2016/04/30 03:16:16
Please use assert_equal(actual, expected)
chrishtr
2016/04/30 21:56:30
Done.
| |
26 assert_true(layers.children[0].paintInvalidations[3].reason == " invalidate paint rectangle"); | |
yosin_UTC9
2016/04/30 03:16:17
Please use assert_equal(actual, expected)
chrishtr
2016/04/30 21:56:30
Done.
| |
27 // Check that thet x offset is 22. This for the caret rect after delete. | |
28 assert_true(layers.children[0].paintInvalidations[3].rect[3] == 21); | |
yosin_UTC9
2016/04/30 03:16:17
Please use assert_equal(actual, expected)
chrishtr
2016/04/30 21:56:30
Done.
| |
29 } | |
30 }); | |
31 | |
yosin_UTC9
2016/04/30 03:16:16
nit: No need to have extra blank lines.
| |
32 | |
33 </script> | |
OLD | NEW |