Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / surroundContents-1.html
blobd655ae9140120aea1475c3fdc5ae2dcc52f17cdd
1 <p>This tests for HIERARCHY_REQUEST_ERRs when calling Range::surroundContents.</p>
2 <div id="select" style="border: 1px solid blue;">Hello world.</div>
3 <div id="insert" style="border: 1px solid red;"></div>
4 <ul id="console"></ul>
5 <script>
6 function log(str) {
7 var li = document.createElement("li");
8 li.appendChild(document.createTextNode(str));
9 var console = document.getElementById("console");
10 console.appendChild(li);
13 var range = document.createRange();
14 var select = document.getElementById("select");
15 var text = select.firstChild;
17 var insert = document.getElementById("insert");
19 range.setStart(text, 0);
20 range.setEnd(text, text.length);
22 try {
23 range.surroundContents(select);
24 } catch (e) {
25 var error = "HierarchyRequestError: Failed to execute 'surroundContents' on 'Range': The node provided contains the insertion point; it may not be inserted into itself.";
26 if (e != error)
27 log ("Failure, expected: " + error + "Was " + e);
30 try {
31 range.surroundContents(insert);
32 } catch (e) {
33 log ("Failure: " + error);
35 </script>