blob: 83663ed14d50f2f6fc021fd6b1674eb9636fe3da [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>This tests that bitmap background images sized and positioned properly on subpixels when background-origin is present.</title>
<style>
div {
background: url("resources/black25x25.png");
position: fixed;
top: 0px;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<p id="container"></p>
<script>
var container = document.getElementById("container");
w=50; h=50;
for (i = 0; i < 10; ++i) {
var e = document.createElement("div");
e.style.left = (w * i) + "px";
e.style.width = w + "px";
e.style.height = h + "px";
e.style.backgroundOrigin = "border-box";
e.style.borderLeft = "solid 25px red";
container.appendChild(e);
w+=0.1;
h+=0.1;
}
w=50; h=50;
for (i = 0; i < 10; ++i) {
var e = document.createElement("div");
e.style.left = (w * i) + "px";
e.style.top = "50px";
e.style.width = w + "px";
e.style.height = h + "px";
e.style.backgroundOrigin = "padding-box";
e.style.borderLeft = "solid 25px red";
container.appendChild(e);
w+=0.1;
h+=0.1;
}
w=50; h=50;
padding = 0;
for (i = 0; i < 10; ++i) {
var e = document.createElement("div");
e.style.left = (w * i) + "px";
e.style.top = "100px";
e.style.width = w + "px";
e.style.height = h + "px";
e.style.backgroundOrigin = "content-box";
e.style.paddingLeft = padding + "px";
e.style.borderLeft = "solid 25px red";
container.appendChild(e);
w+=0.1;
h+=0.1;
padding+=0.1;
}
</script>
</body>
</html>