servo/components/layout
eri 01820e2a8a
Improve how intrinsic sizes work for videos (#31746)
* feat: patch for video layout sizes

added rebase from main 2024/10/05

Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: eri <epazos@igalia.com>

* feat: take width and height parameters if provided

Signed-off-by: eri <epazos@igalia.com>

* chore: tidy the code and update test expectations

Signed-off-by: eri <epazos@igalia.com>

* feat: handle removing poster

Signed-off-by: eri <epazos@igalia.com>

* chore: update test expectations and remove debug code

Signed-off-by: eri <epazos@igalia.com>

* fix: issues after rebasing to main

Signed-off-by: eri <epazos@igalia.com>

* feat: pass src remove test and tidy

Signed-off-by: eri <epazos@igalia.com>

* chore: clippy fixes

Signed-off-by: eri <epazos@igalia.com>

* chore: update passing test expectations

Signed-off-by: eri <epazos@igalia.com>

* fix object-position-svg test

Signed-off-by: eri <epazos@igalia.com>

* fix unintentional override of video size and resize events

Signed-off-by: eri <epazos@igalia.com>

* change how resize events are sent to better match the spec

Signed-off-by: eri <epazos@igalia.com>

* simplify poster mutation handling

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: eri <eri@inventati.org>

* improved handling of intrinsic sizes

- differentiate between natural size and css size
- presentational attributes
- fallback ratio for video element
- handle more cases where the src/poster are added/removed
- aspect ratio hints

Signed-off-by: eri <epazos@igalia.com>

* update test expectations

Signed-off-by: eri <epazos@igalia.com>

* fix cleaning current frame

Signed-off-by: eri <epazos@igalia.com>

* update test expectations

Signed-off-by: eri <epazos@igalia.com>

* Apply suggestions from code review

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: eri <eri@inventati.org>

* More code review suggestions

Signed-off-by: eri <epazos@igalia.com>

* Prevent aspect-ratio:auto from pulling the ratio from the default object size

As resolved in https://github.com/w3c/csswg-drafts/issues/7524#issuecomment-1204462924

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

---------

Signed-off-by: eri <epazos@igalia.com>
Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-10-29 22:42:22 +00:00
..
display_list Improve how intrinsic sizes work for videos (#31746) 2024-10-29 22:42:22 +00:00
block.rs Upgrade Stylo to 2024-10-04 (#33767) 2024-10-20 19:53:38 +00:00
Cargo.toml Remove size_of_test macro from legacy layout and inline it (#34055) 2024-10-29 14:46:10 +00:00
construct.rs fonts: Make FontContext thread-safe and share it per-Layout (#32205) 2024-05-02 10:34:10 +00:00
context.rs fonts: Simplify FontContext in two ways that affect the unit test (#33541) 2024-09-25 20:15:47 +00:00
data.rs script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00
flex.rs Upgrade Stylo to 2024-10-04 (#33767) 2024-10-20 19:53:38 +00:00
floats.rs Enable min-content, max-content, fit-content and stretch (#33492) 2024-09-20 14:48:27 +00:00
flow.rs clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674) 2024-07-04 14:18:58 +00:00
flow_list.rs Lint layout_2013 with clippy (#31221) 2024-01-30 11:46:35 +00:00
flow_ref.rs Address issues uncovered by rust-1.78 beta (#32130) 2024-04-22 18:20:47 +00:00
fragment.rs Improve how intrinsic sizes work for videos (#31746) 2024-10-29 22:42:22 +00:00
generated_content.rs Replace lazy_static crate with std::sync::LazyLock in layout and config (#33065) 2024-08-15 16:28:04 +00:00
incremental.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
inline.rs fonts: Simplify FontContext in two ways that affect the unit test (#33541) 2024-09-25 20:15:47 +00:00
layout_debug.rs clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674) 2024-07-04 14:18:58 +00:00
lib.rs layout: Add support for white-space-collapse: break-spaces (#32388) 2024-05-30 05:33:07 +00:00
linked_list.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
list_item.rs fonts: Make FontContext thread-safe and share it per-Layout (#32205) 2024-05-02 10:34:10 +00:00
model.rs Upgrade Stylo to 2024-10-04 (#33767) 2024-10-20 19:53:38 +00:00
multicol.rs Enable min-content, max-content, fit-content and stretch (#33492) 2024-09-20 14:48:27 +00:00
parallel.rs clippy: Fix warnings in components/layout (#31612) 2024-03-11 10:24:36 +00:00
persistent_list.rs Lint layout_2013 with clippy (#31221) 2024-01-30 11:46:35 +00:00
query.rs Layout: Implement innerText/outerText (#33312) 2024-09-24 09:45:33 +00:00
sequential.rs dependencies: Upgrade to WebRender 0.64 (#31486) 2024-03-14 17:40:54 +00:00
table.rs Enable min-content, max-content, fit-content and stretch (#33492) 2024-09-20 14:48:27 +00:00
table_caption.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
table_cell.rs Enable min-content, max-content, fit-content and stretch (#33492) 2024-09-20 14:48:27 +00:00
table_colgroup.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
table_row.rs Enable min-content, max-content, fit-content and stretch (#33492) 2024-09-20 14:48:27 +00:00
table_rowgroup.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
table_wrapper.rs Enable min-content, max-content, fit-content and stretch (#33492) 2024-09-20 14:48:27 +00:00
text.rs fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
text_run.rs fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
traversal.rs Replace .map_or(false with Option::is_some_and (#33468) 2024-09-16 10:03:52 +00:00
wrapper.rs Upgrade stylo to 2024-05-15 (#32334) 2024-05-27 15:24:34 +00:00