Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / deleted-range-endpoints.html
blob69af1bae93bf30203740c67e6e97e3415b92d1ec
1 <p>Test some cases of Range.deleteContents() behavior (namely, examples from DOM Range spec).</p>
2 <pre id="console"></pre>
4 <div style="visibility:hidden">
5 <FOO>AB<MOO>CD</MOO>CD</FOO>
6 <FOO>A<MOO>BC</MOO>DE</FOO>
7 <FOO>XY<BAR>ZW</BAR>Q</FOO>
8 <FOO><BAR1>AB</BAR1><BAR2></BAR2><BAR3>CD</BAR3></FOO>
9 </div>
10 <script>
11 if (window.testRunner)
12 testRunner.dumpAsText();
14 function log(message)
16 document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
19 // Simple recursive "give me a string to represent this tree" function
20 function treeAsString(node) {
21 var string = node.nodeName;
22 if (string[0] != "#")
23 string = "<" + string + ">";
24 if (string == "#text")
25 string = node.textContent;
26 if (node.childNodes.length) {
27 string += " [";
29 for (var x = 0; x < node.childNodes.length; x++) {
30 if (x != 0) {
31 string += ", ";
33 string += treeAsString(node.childNodes[x]);
36 if (node.childNodes.length) {
37 string += "]";
39 return string;
42 var range = document.createRange();
44 var foo = document.getElementsByTagName("FOO")[0];
45 range.setStart(foo.firstChild, 1);
46 range.setEnd(foo, 2);
47 range.deleteContents();
48 log(treeAsString(foo) + ". Final range (" + range.startContainer.nodeName + ", " + range.startOffset + ") - (" + range.endContainer.nodeName + ", " + range.endOffset + ")");
50 var foo = document.getElementsByTagName("FOO")[1];
51 range.setStart(foo.firstChild.nextSibling.firstChild, 1);
52 range.setEnd(foo.lastChild, 1);
53 range.deleteContents();
54 log(treeAsString(foo) + ". Final range (" + range.startContainer.nodeName + ", " + range.startOffset + ") - (" + range.endContainer.nodeName + ", " + range.endOffset + ")");
56 var foo = document.getElementsByTagName("FOO")[2];
57 range.setStart(foo.firstChild, 1);
58 range.setEnd(foo.firstChild.nextSibling.firstChild, 1);
59 range.deleteContents();
60 log(treeAsString(foo) + ". Final range (" + range.startContainer.nodeName + ", " + range.startOffset + ") - (" + range.endContainer.nodeName + ", " + range.endOffset + ")");
62 var foo = document.getElementsByTagName("FOO")[3];
63 range.setStart(foo.firstChild.firstChild, 1);
64 range.setEnd(foo.lastChild.firstChild, 1);
65 range.deleteContents();
66 log(treeAsString(foo) + ". Final range (" + range.startContainer.nodeName + ", " + range.startOffset + ") - (" + range.endContainer.nodeName + ", " + range.endOffset + ")");
68 </script>