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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-constructor.html

Issue 2022863002: [InputEvent] Introduce |StaticRange| and use in |InputEvent::getRanges()| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-no-mutate.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>StaticRange: constructor</title>
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 abcdefg
10 <script>
11 test(function() {
12 // Basic interface.
13 assert_equals(typeof new StaticRange, 'object');
14 assert_equals(Object.prototype.toString.call(new StaticRange), '[object Stat icRange]');
15 assert_true(new StaticRange instanceof StaticRange);
16 assert_equals(Object.getPrototypeOf(new StaticRange), StaticRange.prototype) ;
17
18 // Initialize new StaticRange.
19 var txt = document.body.firstChild;
20 var staticRange = new StaticRange();
21 staticRange.setStart(txt, 0);
22 staticRange.setEnd(txt, 5);
23 assert_equals(staticRange.startContainer, txt);
24 assert_equals(staticRange.startOffset, 0);
25 assert_equals(staticRange.endContainer, txt);
26 assert_equals(staticRange.endOffset, 5);
27 assert_false(staticRange.collapsed);
28
29 // Property mutable.
30 staticRange.startContainer = document.body;
31 staticRange.startOffset = 0;
32 staticRange.endContainer = document.body;
33 staticRange.endOffset = 0;
34 assert_equals(staticRange.startContainer, document.body);
35 assert_equals(staticRange.startOffset, 0);
36 assert_equals(staticRange.endContainer, document.body);
37 assert_equals(staticRange.endOffset, 0);
38 assert_true(staticRange.collapsed);
39 }, 'Testing StaticRange constructor');
40 </script>
41 </body>
42 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/StaticRange/staticrange-no-mutate.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698