servo/tests/wpt/meta/css/css-lists
Mukilan Thiyagarajan 8a20e42de4
Add support for static SVG images using resvg crate (#36721)
This change adds support for rendering static SVG images using the
`resvg` crate, allowing svg sources in the `img` tag and in CSS
`background` and `content` properties. There are some limitations in
using resvg:

1. There is no support for animations or interactivity as these would
require implementing the full DOM layer of SVG specification.
2. Only system fonts can be used for text rendering. There is some
mechanism to provide a custom font resolver to usvg, but that is not
explored in this change.
3. resvg's handling of certain edge cases involving lack of explicit
`width` and `height` on the root svg element deviates from what the
specification expects from browsers. For example, resvg uses the values
in `viewBox` to derive the missing width or height dimension, but
without scaling that dimension to preserve the aspect ratio. It also
doesn't allow overriding this behavior.

Demo screenshot:
![servo - resvg
img](https://github.com/user-attachments/assets/8ecb2de2-ab7c-48e2-9f08-2d09d2cb8791)

<details>
<summary>Source</summary>

```
<style>
 #svg1 {
   border: 1px solid red;
 }

 #svg2 {
   border: 1px solid red;
   width: 300px;
 }
 #svg3 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: contain;
 }
 #svg4 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: cover;
 }
 #svg5 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: fill;
 }
 #svg6 {
   border: 1px solid red;
   width: 300px;
   height: 200px;
   object-fit: none;
 }
</style>
</head>
<body>
        <div>
          <img id="svg1" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
        </div>
        <div>
          <img id="svg2" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
          <img id="svg3" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
          <img id="svg4" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
        </div>
        <div>
          <img id="svg5" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
          <img id="svg6" src="https://raw.githubusercontent.com/servo/servo/refs/heads/main/resources/servo.svg" alt="Servo logo">
        </div>
</body>
```

</details>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-05-27 11:02:40 +00:00
..
animations Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
content-property Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
parsing Update web-platform-tests to revision b'c72ee0c082d350b8b44f7a6bac1f028752b13527' (#34837) 2025-01-05 01:59:46 +00:00
counter-001.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-002.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-003.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-004.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-important.html.ini Update web-platform-tests to revision b'f2cdcb7e9550e74d07ed6cf17bbcb9643aeedb99' (#32381) 2024-05-26 03:58:17 +00:00
counter-increment-inside-display-contents.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-list-item-2.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-list-item-3.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-list-item-slot-order.html.ini Include non-shadowdom children of shadow hosts in style calculation (#34298) 2024-11-20 19:28:35 +00:00
counter-list-item.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-increment-overflow-underflow.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-increment-set-display-contents.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-increment-set-display-none.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-inside-display-contents.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-reversed-list-item-start.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-reversed-list-item.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-reversed-not-list-item-start.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-reset-reversed-not-list-item.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counter-set-001.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-001.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-002.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-003.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-004.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-005.html.ini Update web-platform-tests to revision b'8f48f40aab7f7f8a8118dc1a46972d070622be52' (#32271) 2024-05-12 04:42:20 +00:00
counters-006.html.ini Update web-platform-tests to revision b'ed9e9309618bdf76de06ff85757edbc8e1d7da82' (#32512) 2024-06-16 04:41:02 +00:00
counters-scope-001.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-scope-002.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-scope-003.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
counters-scope-004.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
css-lists-no-interpolation.html.ini Implement transition-behavior (#33991) 2024-10-24 20:34:10 +00:00
details-open.html.ini Update web-platform-tests to revision b'f46bf6aa167e2838a8b93501a1a998ffde90d879' (#32581) 2024-06-23 06:21:30 +00:00
foo-counter-reversed-006a.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
foo-counter-reversed-006b.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
foo-counter-reversed-006c.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
foo-counter-reversed-006d.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
foo-counter-reversed-006e.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
foo-counter-reversed-008a.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
foo-counter-reversed-008b.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
implicit-and-explicit-list-item-counters.html.ini Update web-platform-tests to revision b'f46bf6aa167e2838a8b93501a1a998ffde90d879' (#32581) 2024-06-23 06:21:30 +00:00
inheritance.html.ini layout: Add a basic support for list-style-position: outside (#32114) 2024-04-22 14:23:35 +00:00
inline-block-list-marker.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
inline-block-list.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
inline-list-marker.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
inline-list-with-table-child.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
inline-list.html.ini layout: Add initial support for bidirectional text (BiDi) (#33148) 2024-08-21 14:28:54 +00:00
li-counter-increment-computed-style.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
li-value-reversed-006a.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
li-value-reversed-006b.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
li-value-reversed-006c.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
li-value-reversed-006d.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
li-value-reversed-006e.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
li-value-reversed-008a.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
li-value-reversed-008b.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-and-flex-001.html.ini layout: Enable flexbox by default on non-legacy layout (#33186) 2024-08-26 13:50:52 +00:00
list-marker-symbol-bidi.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-image-gradients-dynamic.html.ini Add support for static SVG images using resvg crate (#36721) 2025-05-27 11:02:40 +00:00
list-style-image-gradients.html.ini Add support for static SVG images using resvg crate (#36721) 2025-05-27 11:02:40 +00:00
list-style-type-decimal-vertical-lr.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-decimal-vertical-rl.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-001a.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-001b.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-002.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-003.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-005a.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-005b.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-006.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
list-style-type-string-007.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
marker-dynamic-content-change.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
marker-webkit-text-fill-color.html.ini Enable more css tests (#31469) 2024-03-01 07:49:39 +00:00
nested-marker-styling.html.ini Update web-platform-tests to revision b'6d461cc41e1a9951e1991a94f651e389b0ca24ba' (#34360) 2024-11-24 01:40:36 +00:00
pseudo-element-remove-update.html.ini Update web-platform-tests to revision b'3634d5a63f2fa3969616396d95537c91c3348fe5' (#32959) 2024-08-07 10:15:56 +00:00