haikuwebkit/LayoutTests/fast/inline/hidpi-select-inline-on-subp...

41 lines
874 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>This tests that inline text selection can paint to subpixel position.</title>
<style>
::selection {
background: rgba(255, 0, 0, 0.9);
}
div {
font-size: 16px;
width: 1px;
height: 1px;
position: fixed;
}
</style>
</head>
<body>
<p id="container"></p>
<script>
var container = document.getElementById("container");
adjustment = 0.1;
for (i = 0; i < 10; ++i) {
adjustment+=0.1;
for (j = 0; j < 10; ++j) {
var e = document.createElement("div");
e.style.top = (30 * i + j * adjustment) + "px";
e.style.left = (30 * j + i * adjustment) + "px";
e.innerHTML = "foo";
container.appendChild(e);
}
}
var range = document.createRange();
range.selectNode(document.getElementById("container"));
window.getSelection().addRange(range);
</script>
</body>
</html>