blob: 4ad575c1ec57dbd043cc25623eab3698d2f792f9 [file] [edit]
<!DOCTYPE html>
<html>
<head>
<title>Reference: a selection on the line after a block level box does not cover the box's margin.</title>
<style>
::selection { background-color: green; }
body { margin: 0; font: 16px/16px Ahem; color: transparent; }
.container { width: 100px; }
.box { height: 32px; background-color: silver; }
.spacer { height: 32px; }
</style>
</head>
<body>
<div class="container">xx<span><div class="box"></div><div class="spacer"></div></span><span id="target">xx</span></div>
<script>
var range = document.createRange();
range.selectNodeContents(document.getElementById("target"));
window.getSelection().addRange(range);
</script>
</body>
</html>