OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <title>StaticRange: Property mutable and .setStart/.setEnd</title> | |
3 <script src="/resources/testharness.js"></script> | |
4 <script src="/resources/testharnessreport.js"></script> | |
5 <div id='txt'> | |
6 abcdefg | |
7 </div> | |
8 <script> | |
9 test(() => { | |
10 const txt = document.getElementById('txt'); | |
11 const staticRange = new StaticRange(); | |
12 staticRange.startContainer = txt; | |
13 staticRange.startOffset = 0; | |
14 staticRange.endContainer = txt; | |
15 staticRange.endOffset = 1; | |
16 assert_equals(staticRange.startContainer, txt); | |
17 assert_equals(staticRange.startOffset, 0); | |
18 assert_equals(staticRange.endContainer, txt); | |
19 assert_equals(staticRange.endOffset, 1); | |
20 assert_false(staticRange.collapsed); | |
21 }, 'Property mutable'); | |
foolip
2017/04/04 04:32:36
Suggest 'Mutable attributes' or 'Attributes are mu
chongz
2017/04/07 18:14:11
Changed to test "Attributes are immutable".
| |
22 | |
23 test(() => { | |
24 const txt = document.getElementById('txt'); | |
25 const staticRange = new StaticRange(); | |
26 staticRange.setStart(txt, 0); | |
27 staticRange.setEnd(txt, 1); | |
28 assert_equals(staticRange.startContainer, txt); | |
29 assert_equals(staticRange.startOffset, 0); | |
30 assert_equals(staticRange.endContainer, txt); | |
31 assert_equals(staticRange.endOffset, 1); | |
32 assert_false(staticRange.collapsed); | |
33 }, 'setStart, setEnd'); | |
foolip
2017/04/04 04:32:36
Can you split this into two separate tests, and as
chongz
2017/04/07 18:14:11
Removed |setStart/End()|.
| |
34 </script> | |
OLD | NEW |