mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Properly handle fallback aspect ratio for videos (#34082)
A `<video>` element with no source won't have a natural aspect ratio, but `aspect-ratio: auto` should still fall back to a ratio of 300/150. `used_size_as_if_inline_element_from_content_box_sizes()` was already handling this, but other consumers of `preferred_aspect_ratio()` were wrong. In particular, this resulted in a 0px wide inline-block: ```html <div style="display: inline-block; border: solid"> <video style="height: 100px; background: cyan"></video> </div> ``` So this patch moves the fallback into `preferred_aspect_ratio()`. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
31566aef02
commit
851b125d4b
4 changed files with 70 additions and 15 deletions
9
tests/wpt/meta/css/css-sizing/intrinsic-size-fallback-video.html.ini
vendored
Normal file
9
tests/wpt/meta/css/css-sizing/intrinsic-size-fallback-video.html.ini
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
[intrinsic-size-fallback-video.html]
|
||||
[.wrapper 1]
|
||||
expected: FAIL
|
||||
|
||||
[.wrapper 3]
|
||||
expected: FAIL
|
||||
|
||||
[.wrapper 4]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue