Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / 5241148.html
blob803818ea26116e4c3e24478ff1f94207e64f77ca
1 <p>This tests to see that the Selection object's properties return valid DOM positions (not our internal editing positions). We should be able to create Range objects out of those positions w/o issue.</p>
2 <div id="div" contenteditable="true">foo<img src="../resources/abe.png"><br></div>
4 <script>
5 if (window.testRunner)
6 window.testRunner.dumpAsText();
8 div = document.getElementById("div");
9 selection = window.getSelection();
10 try {
11 selection.setBaseAndExtent(div, 0, div, 2);
12 extentNode = selection.extentNode;
13 extentOffset = selection.extentOffset;
14 range = document.createRange();
15 range.setStart(extentNode, extentOffset);
16 range.setEnd(extentNode, extentOffset);
17 selection.removeAllRanges();
18 selection.addRange(range);
19 alert("Success");
21 } catch (e) {
22 alert("Failed: " + e);
24 </script>