Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html b/third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..700d2d8d4f7cfb5714dc3f395f4bd5e45c31ef64 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html |
| @@ -0,0 +1,28 @@ |
| +<!doctype html> |
| +<title>StaticRange: Attributes are immutable</title> |
| +<script src="/resources/testharness.js"></script> |
| +<script src="/resources/testharnessreport.js"></script> |
| +<div id='txt'> |
| +abcdefg |
| +</div> |
| +<script> |
| +test(() => { |
| + const txt = document.getElementById('txt'); |
| + const staticRange = new StaticRange(); |
| + assert_equals(staticRange.startContainer, document); |
| + assert_equals(staticRange.startOffset, 0); |
| + assert_equals(staticRange.endContainer, document); |
| + assert_equals(staticRange.endOffset, 0); |
| + assert_true(staticRange.collapsed); |
| + |
| + staticRange.startContainer = txt; |
| + assert_equals(staticRange.startContainer, document); |
| + staticRange.startOffset = 1; |
| + assert_equals(staticRange.startOffset, 0); |
| + staticRange.endContainer = txt; |
| + assert_equals(staticRange.endContainer, document); |
| + staticRange.endOffset = 1; |
| + assert_equals(staticRange.endOffset, 0); |
| + assert_true(staticRange.collapsed); |
| +}); |
|
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 :)
|
| +</script> |