Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<title>::selection is respected on images</title>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="mismatch" href="selection-image-001-noref.html">
<style>
img::-moz-selection {
background: green;
}
img::selection {
background: green;
}
</style>
<p>
Some text <img src="resources/blue15x15.png"> some more.
</p>
<script>
onload = () => {
getSelection().removeAllRanges();
let r = document.createRange();
r.selectNode(document.documentElement);
getSelection().addRange(r);
}
</script>