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

Side by Side Diff: LayoutTests/fast/dom/Range/resources/intersectsNode.js

Issue 23404003: Make Range methods to work with detached node (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-08-27T11:16:22 Created 7 years, 3 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 description( 1 description(
2 "This test checks the behavior of the intersectsNode() method on the Range objec t.<br>" + 2 "This test checks the behavior of the intersectsNode() method on the Range objec t.<br>" +
3 "It covers all configurations of the node/Range relationship and some exception conditions." 3 "It covers all configurations of the node/Range relationship and some exception conditions."
4 ); 4 );
5 5
6 var range = document.createRange(); 6 var range = document.createRange();
7 var intersects = 0; 7 var intersects = 0;
8 8
9 debug("1.1 Node starts before the range and ends before the range"); 9 debug("1.1 Node starts before the range and ends before the range");
10 range.selectNode(document.getElementById("a2")); 10 range.selectNode(document.getElementById("a2"));
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 intersects = range.intersectsNode(node); 106 intersects = range.intersectsNode(node);
107 shouldBeFalse("intersects"); 107 shouldBeFalse("intersects");
108 debug(""); 108 debug("");
109 109
110 debug("2.3 Node has no parent"); 110 debug("2.3 Node has no parent");
111 range.selectNode(document.getElementById("a2")); 111 range.selectNode(document.getElementById("a2"));
112 shouldThrow("range.intersectsNode(document)"); 112 shouldThrow("range.intersectsNode(document)");
113 debug(""); 113 debug("");
114 114
115 debug("2.4 Range has no parent"); 115 debug("2.4 Range has no parent");
116 shouldThrow("range.selectNode(document)"); 116 shouldThrow("range.selectNode(document)", '"InvalidNodeTypeError: Failed to exec ute \'selectNode\' on \'Range\': the given Node has no parent."');
117 debug(""); 117 debug("");
118 118
119 debug("2.5 Wrong documents"); 119 debug("2.5 Wrong documents");
120 // firefox does not throw an exception here instead it returns 0 120 // firefox does not throw an exception here instead it returns 0
121 var src1 = "<html>\n<head>\n<body>\n<div id=f1>f1</div>\n</body>\n</head>\n<html >"; 121 var src1 = "<html>\n<head>\n<body>\n<div id=f1>f1</div>\n</body>\n</head>\n<html >";
122 window.frames['frame1'].document.open("text/html", "replace"); 122 window.frames['frame1'].document.open("text/html", "replace");
123 window.frames['frame1'].document.write(src1); 123 window.frames['frame1'].document.write(src1);
124 window.frames['frame1'].document.close(); 124 window.frames['frame1'].document.close();
125 125
126 var src2 = "<html>\n<head>\n<body>\n<div id=f2>f2</div>\n</body>\n</head>\n<html >"; 126 var src2 = "<html>\n<head>\n<body>\n<div id=f2>f2</div>\n</body>\n</head>\n<html >";
(...skipping 10 matching lines...) Expand all
137 debug(""); 137 debug("");
138 138
139 debug("2.6 Node deleted"); 139 debug("2.6 Node deleted");
140 range.selectNode(document.getElementById("a2")); 140 range.selectNode(document.getElementById("a2"));
141 var node = null; 141 var node = null;
142 shouldThrow("range.intersectsNode(node)"); 142 shouldThrow("range.intersectsNode(node)");
143 debug(""); 143 debug("");
144 144
145 if (window.testRunner) 145 if (window.testRunner)
146 testRunner.dumpAsText(); 146 testRunner.dumpAsText();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698