Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / range-clone-contents.html
blob2df7dfd4f58838a8773d99e8713c3af7fd67f429
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/dump-as-markup.js"></script>
5 </head>
6 <body>
7 <div id="test"><div><a href="#">link</a></div><div></div><div><br><br><img src="" id="img-tag"></div><div><br><br>text</div></div>
8 <div id="expectations">
9 <div id="test_right_complex_subtree"><div><a href="#">link</a></div><div></div><div><br><br></div></div>
10 <div id="test_left_complex_subtree"><div></div><div><br><br>text</div></div>
11 </div>
12 <pre id="console"></pre>
13 <script>
15 function log(message) {
16 document.getElementById('console').innerHTML += message + '\n';
19 function testCloneContents(description, range, expectedContentsId) {
20 var actualContents = range.cloneContents();
22 var action = description + ' yields:\n' + Markup.get(actualContents).replace(/</g, '&lt;');
23 var expectedContents = document.getElementById(expectedContentsId);
24 if (Markup.get(actualContents) == Markup.get(expectedContents))
25 log('PASS: ' + action);
26 else
27 log('FAIL: ' + action + '\n but expected:\n' + Markup.get(expectedContents).replace(/</g, '&lt;'));
29 log('');
32 Markup.noAutoDump();
34 var test = document.getElementById('test');
35 log('test contents:\n' + Markup.get(test).replace(/</g, '&lt;') + '\n')
37 var range = document.createRange();
39 range.setStartBefore(test.firstChild);
40 var imgTag = document.getElementById('img-tag')
41 range.setEndBefore(imgTag);
43 testCloneContents('Cloning right complex subtree', range, 'test_right_complex_subtree');
45 range.setStartAfter(imgTag);
46 range.setEndAfter(test.lastChild);
48 testCloneContents('Cloning left complex subtree', range, 'test_left_complex_subtree');
50 test.style.display = 'none';
51 document.getElementById('expectations').style.display = 'none';
53 log('DONE');
55 </script>
56 </body>
57 </html>