Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / resources / chromium-selectionAsMarkup.html
blob1b833f81121b65a5b0cd09f6ade67c447b7bb0ef
1 <style>
2 .red {
3 color: red;
5 </style>
7 <p>
8 <div id="selection">
9 <a href="chromium-selectionAsMarkup.html" class="red">hello</a>
10 </div>
11 not selection
12 </p>
14 <script>
15 onload = function() {
16 var range = document.createRange();
17 range.selectNodeContents(document.getElementById("selection"));
18 document.getSelection().addRange(range);
19 var sel = testRunner.selectionAsMarkup();
21 var errors = "";
23 if (sel.indexOf("not selection") != -1)
24 errors += "FAIL: non-selection text found\n";
25 if (sel.indexOf("color: red") == -1)
26 errors += "FAIL: style not pushed down\n";
27 if (sel.indexOf("resources/chromium-selectionAsMarkup.html") == -1)
28 errors += "FAIL: url not resolved\n";
30 if (errors == "")
31 document.body.innerText = "PASS";
32 else
33 document.body.innerText = errors;
35 testRunner.notifyDone();
37 </script>
39 <p>
40 This test makes sure that the markup used by print selection
41 contains absolute urls and pushed down styles. This test depends
42 on testRunner.
43 </p>