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

Side by Side Diff: LayoutTests/fast/dom/Range/surroundContents-1.html

Issue 16818023: DOMException toString is not correct (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 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 | Annotate | Revision Log
OLDNEW
1 <p>This tests for HIERARCHY_REQUEST_ERRs when calling Range::surroundContents.</ p> 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> 2 <div id="select" style="border: 1px solid blue;">Hello world.</div>
3 <div id="insert" style="border: 1px solid red;"></div> 3 <div id="insert" style="border: 1px solid red;"></div>
4 <ul id="console"></ul> 4 <ul id="console"></ul>
5 <script> 5 <script>
6 function log(str) { 6 function log(str) {
7 var li = document.createElement("li"); 7 var li = document.createElement("li");
8 li.appendChild(document.createTextNode(str)); 8 li.appendChild(document.createTextNode(str));
9 var console = document.getElementById("console"); 9 var console = document.getElementById("console");
10 console.appendChild(li); 10 console.appendChild(li);
11 } 11 }
12 12
13 var range = document.createRange(); 13 var range = document.createRange();
14 var select = document.getElementById("select"); 14 var select = document.getElementById("select");
15 var text = select.firstChild; 15 var text = select.firstChild;
16 16
17 var insert = document.getElementById("insert"); 17 var insert = document.getElementById("insert");
18 18
19 range.setStart(text, 0); 19 range.setStart(text, 0);
20 range.setEnd(text, text.length); 20 range.setEnd(text, text.length);
21 21
22 try { 22 try {
23 range.surroundContents(select); 23 range.surroundContents(select);
24 } catch (e) { 24 } catch (e) {
25 var error = "Error: HierarchyRequestError: DOM Exception 3"; 25 var error = "HierarchyRequestError: A Node was inserted somewhere it doesn't belong.";
26 if (e != error) 26 if (e != error)
27 log ("Failure, expected: " + error); 27 log ("Failure, expected: " + error);
28 } 28 }
29 29
30 try { 30 try {
31 range.surroundContents(insert); 31 range.surroundContents(insert);
32 } catch (e) { 32 } catch (e) {
33 log ("Failure: " + error); 33 log ("Failure: " + error);
34 } 34 }
35 </script> 35 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698