layout: Improve sizing for inline SVG (#38603)

The metadata provided by usvg has unreliable sizes. Ignore it, and rely
on the `width`, `height` and `viewBox` attributes instead.

Note that inline SVG with a natural aspect ratio but no natural sizes
should stretch to the containing block. This is left for a follow-up.

Bumps Stylo to https://github.com/servo/stylo/pull/229

Testing: Improves several WPT.

---------

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Oriol Brufau 2025-08-12 05:45:15 -07:00 committed by GitHub
parent 319f4f0e38
commit 141413d52e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 156 additions and 260 deletions

24
Cargo.lock generated
View file

@ -7328,7 +7328,7 @@ dependencies = [
[[package]]
name = "selectors"
version = "0.31.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"bitflags 2.9.1",
"cssparser",
@ -7634,7 +7634,7 @@ dependencies = [
[[package]]
name = "servo_arc"
version = "0.4.1"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"serde",
"stable_deref_trait",
@ -8108,7 +8108,7 @@ dependencies = [
[[package]]
name = "stylo"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"app_units",
"arrayvec",
@ -8165,7 +8165,7 @@ dependencies = [
[[package]]
name = "stylo_atoms"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -8174,12 +8174,12 @@ dependencies = [
[[package]]
name = "stylo_config"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
[[package]]
name = "stylo_derive"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"darling",
"proc-macro2",
@ -8191,7 +8191,7 @@ dependencies = [
[[package]]
name = "stylo_dom"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"bitflags 2.9.1",
"stylo_malloc_size_of",
@ -8200,7 +8200,7 @@ dependencies = [
[[package]]
name = "stylo_malloc_size_of"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"app_units",
"cssparser",
@ -8217,12 +8217,12 @@ dependencies = [
[[package]]
name = "stylo_static_prefs"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
[[package]]
name = "stylo_traits"
version = "0.6.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"app_units",
"bitflags 2.9.1",
@ -8637,7 +8637,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "to_shmem"
version = "0.2.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"cssparser",
"servo_arc",
@ -8650,7 +8650,7 @@ dependencies = [
[[package]]
name = "to_shmem_derive"
version = "0.1.0"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#092e34b20bd666da62b7dfc1da5c5e0b64d3c960"
source = "git+https://github.com/servo/stylo?branch=2025-08-01#d2519c05c9d7db31c91552d3337578270645d797"
dependencies = [
"darling",
"proc-macro2",