Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html

Issue 2791373002: [InputEvent] Make StaticRange immutable and move tests to wpt (Closed)
Patch Set: Make attributes immutable and address foolip's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698