Commit Graph

3 Commits

Author SHA1 Message Date
Andrei Volykhin
ef9f16027b html: Add missing 'width' and 'height' reflected IDL dimension attributes (#39606)
The HTML specification defines the 'width' and 'height' attributes as
dimension attributes for the embedded content and images (img, iframe,
embed, object, video, source, input with image type)
https://html.spec.whatwg.org/multipage/#dimension-attributes and for the
tables (table, col, colgroup, thead, tbody, tfoot, tr, td, th) even
these attributes are marked as obsolete.

And UA are expected to use these 'width' and 'height' attributes as
style presentational hints for the rendering.

The embedded content and images:
https://html.spec.whatwg.org/multipage/#dimRendering

The tables:
https://html.spec.whatwg.org/multipage/#tables-2:the-table-element-4

Added missing 'width' and/or 'height' reflected IDL attributes:
- conformant 'unsigned long' IDL attributes for the 'img, source, video'
(with new macro 'make_dimension_uint*)
- obsolete 'DOMString' IDL attributes for the 'td, th, col, colgroup'

Moved the `fn attribute_affects_presentational_hints()` from Element to
specific HTML and SVG elements with attributes which affects
presentational hints for rendering.

Testing: Improvements in the following tests
- html/dom/idlharness.https.html
- html/dom/reflection-embedded.html
- html/dom/reflection-tabular.html
-
html/rendering/replaced-elements/attributes-for-embedded-content-and-images/picture-aspect-ratio.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-10-09 18:03:47 +00:00
TIN TUN AUNG
972ca77ce1 dom: should change media element's currentSrc to children source element's src in resource selection algorithm. (#36408)
Set the `htmlmediaelement`'s `currenSrc` in
resource-selection-algorithm.
Change the `htmlsourceelement`'s src and srcset to USVString type.

According to
[Spec](https://html.spec.whatwg.org/multipage/media.html#concept-media-load-algorithm),
Step 9.3 for mode is children, should set the `currentSrc` to `src` of
children `htmlsourceelement`.
Also, In the `htmlsourceelement` [interface
definition](https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element),
the `src` and `srcset` attribute should be type `USVString`.

Testing: More WPT tests related to resource selection algorithm are
passing.
Fix: Some spec fix

[Try](https://github.com/rayguo17/servo/actions/runs/14347535616)
cc @xiaochengh

Signed-off-by: rayguo17 <rayguo17@gmail.com>
2025-04-11 06:32:34 +00:00
Josh Matthews
af8d7c2de7 script: Move code generation and webidl files to new script_bindings crate. (#35157)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-24 20:47:43 +00:00