mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
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.
This commit is contained in:
parent
6fcc02e92f
commit
09c53f461d
16 changed files with 521 additions and 34 deletions
40
tests/ref/image_rendering_pixelated_ref.html
Normal file
40
tests/ref/image_rendering_pixelated_ref.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<!-- Tests that `image-rendering: pixelated` causes nearest-neighbor interpolation to be used. -->
|
||||
<style>
|
||||
section {
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 25px;
|
||||
}
|
||||
#a, #d {
|
||||
background: red;
|
||||
}
|
||||
#b, #c {
|
||||
background: blue;
|
||||
}
|
||||
#a, #b {
|
||||
top: 0;
|
||||
}
|
||||
#c, #d {
|
||||
top: 25px;
|
||||
}
|
||||
#a, #c {
|
||||
left: 0;
|
||||
}
|
||||
#b, #d {
|
||||
left: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<section id=a></section>
|
||||
<section id=b></section>
|
||||
<section id=c></section>
|
||||
<section id=d></section>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue