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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/getRangeAt.html

Issue 2695193002: Selection API: setBaseAndExtent() and selectAllChildren() should create new Range based on the spec… (Closed)
Patch Set: rebase Created 3 years, 10 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 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 testRunner.dumpEditingCallbacks();
6 </script>
7 <script>
8 function log(str) {
9 if (str == null)
10 str = "null"
11 var li = document.createElement("li");
12 var pre = document.createElement("pre");
13 pre.appendChild(document.createTextNode(str));
14 li.appendChild(pre);
15 var console = document.getElementById("console");
16 console.appendChild(li);
17 }
18
19 function runTest() {
20 var elem = document.getElementById("test");
21 var sel = window.getSelection();
22
23 if (window.testRunner)
24 window.testRunner.dumpAsText();
25
26 try {
27 sel.setBaseAndExtent(elem, 0, elem, 1);
28 var range = sel.getRangeAt(0);
29 log(range);
30 log(range.startContainer);
31 log(range.endContainer);
32
33 } catch(e) {
34 log("Error: " + e);
35 }
36 }
37 </script></head>
38 <body onload="runTest();">
39 <p>This tests that Selection::getRangeAt(int) returns a valid Range object.</p>
40 <div id="test" style="border:1px solid black; padding:1em;">hello</div>
41 <ul id="console"></ul>
42 </body>
43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698