OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <title>StaticRange: Attributes are immutable</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 assert_equals(staticRange.startContainer, document); | |
13 assert_equals(staticRange.startOffset, 0); | |
14 assert_equals(staticRange.endContainer, document); | |
15 assert_equals(staticRange.endOffset, 0); | |
16 assert_true(staticRange.collapsed); | |
17 | |
18 staticRange.startContainer = txt; | |
19 assert_equals(staticRange.startContainer, document); | |
20 staticRange.startOffset = 1; | |
21 assert_equals(staticRange.startOffset, 0); | |
22 staticRange.endContainer = txt; | |
23 assert_equals(staticRange.endContainer, document); | |
24 staticRange.endOffset = 1; | |
25 assert_equals(staticRange.endOffset, 0); | |
26 assert_true(staticRange.collapsed); | |
27 }); | |
qyearsley
2017/04/11 21:18:46
BTW, is it correct that we're not giving this subt
chongz
2017/04/11 22:11:30
I was following the guide here:
https://chromium.g
qyearsley
2017/04/11 22:31:50
No, that sounds good, I was just curious :-)
foolip
2017/04/12 04:56:23
FWIW, I like it this way :)
| |
28 </script> | |
OLD | NEW |