blob: 1b833f81121b65a5b0cd09f6ade67c447b7bb0ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
<style>
.red {
color: red;
}
</style>
<p>
<div id="selection">
<a href="chromium-selectionAsMarkup.html" class="red">hello</a>
</div>
not selection
</p>
<script>
onload = function() {
var range = document.createRange();
range.selectNodeContents(document.getElementById("selection"));
document.getSelection().addRange(range);
var sel = testRunner.selectionAsMarkup();
var errors = "";
if (sel.indexOf("not selection") != -1)
errors += "FAIL: non-selection text found\n";
if (sel.indexOf("color: red") == -1)
errors += "FAIL: style not pushed down\n";
if (sel.indexOf("resources/chromium-selectionAsMarkup.html") == -1)
errors += "FAIL: url not resolved\n";
if (errors == "")
document.body.innerText = "PASS";
else
document.body.innerText = errors;
testRunner.notifyDone();
}
</script>
<p>
This test makes sure that the markup used by print selection
contains absolute urls and pushed down styles. This test depends
on testRunner.
</p>
|