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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/dom/ranges/StaticRange-mutable.html

Issue 2791373002: [InputEvent] Make StaticRange immutable and move tests to wpt (Closed)
Patch Set: 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: 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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698