servo/tests/ref/background_size_a.html
Patrick Walton 09c53f461d layout: Implement image-rendering per CSS-IMAGES-3 § 5.3 and
`background-size` per CSS-BACKGROUNDS § 3.9.

Nearest neighbor interpolation is used for `crisp-edges`, like Firefox.
A note has been added that we could do better if we wanted to.

Multiple backgrounds are not yet supported.
2015-03-03 17:54:12 +01:00

62 lines
884 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
section {
position: absolute;
top: 0;
width: 40px;
}
#tall {
left: 0;
}
#wide {
left: 40px;
}
div {
width: 40px;
height: 40px;
image-rendering: -moz-crisp-edges; /* for comparison with Firefox */
image-rendering: pixelated;
}
#tall div {
background-image: url(2x4.png);
}
#wide div {
background-image: url(4x2.png);
}
.a {
background-size: 40px 20px;
}
.b {
background-size: 40px 40px;
}
.c {
background-size: 40px;
}
.d {
background-size: cover;
}
.e {
background-size: contain;
}
</style>
</head>
<body>
<section id=tall>
<div class=a></div>
<div class=b></div>
<div class=c></div>
<div class=d></div>
<div class=e></div>
</section>
<section id=wide>
<div class=a></div>
<div class=b></div>
<div class=c></div>
<div class=d></div>
<div class=e></div>
</section>
</body>
</html>