servo/components
Mukilan Thiyagarajan 3cf4ef61ef
bindings: Fix support for interface members in setlike/maplike. (#35651)
#30151 added support for setlike and maplike declarations in WebIDL, but
the tests only validated if generator code worked with 'DOMString' as
the key type. The support for interface type as members was broken as
`DomRoot<T>` didn't satify the bounds `Eq` and `Hash` needed by the
`Key` and `Value` types in `Setlike` and `Maplike` traits respectively.
In addition, the splitting of bindings into a separate 'script_bindings'
crate had also broken support for this in CodegenRust.py, as the types
used within the definition of `DomTraits` were not referenced using
`Self::`.

This patch fixes the WebIDL code generator by doing a simple string
replacement on the return value of `getRetvalDeclarationForType` so that
the proper `Self::` is used. I'm not not sure if there is a better
approach to this as it seems most logic in CodegenRust.py uses the `D::`
prefix that is expected to be available only when compiling `script`
crate and not `script_bindings`.

This patch also adds the missing trait implementations for `DomRoot` and
ensures that the generated code works for both members of primitive and
interface types by splitting the existing `TestBinding{Map,Set}Like`
interfaces into `TestBinding{Map,Set}LikeWith{Primitive,Interface}`
tests.

Fixes #35542.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-02-27 07:04:11 +00:00
..
allocator
background_hang_monitor Only compile platform samplers when cargo feature enabled (#35312) 2025-02-06 06:53:08 +00:00
bluetooth Include WebViewId into EmbedderMsg variants where possible (#35211) 2025-01-30 11:15:35 +00:00
canvas Update to rust 1.85 (#35628) 2025-02-24 17:44:35 +00:00
compositing libservo: Add WebView immediately to the Compositor (#35662) 2025-02-26 16:16:48 +00:00
config compositing: Move image output and shutdown management out of the compositor (#35538) 2025-02-20 18:27:49 +00:00
constellation libservo: Clean up interfaces for alert()/confirm()/prompt() (#35579) 2025-02-27 02:49:08 +00:00
deny_public_fields
devtools libservo: Flesh out permissions API (#35396) 2025-02-10 15:50:33 +00:00
dom_struct script: Feature-gate all crown support. (#35055) 2025-01-18 21:36:15 +00:00
domobject_derive
fonts Update to rust 1.85 (#35628) 2025-02-24 17:44:35 +00:00
geometry
hyper_serde
jstraceable_derive
layout layout: Implement overflow scroll support for different axes (#35414) 2025-02-14 08:14:57 +00:00
layout_2020 layout: Support stretch cross size for flex base size (#35663) 2025-02-26 18:03:38 +00:00
layout_thread script: add skeleton implementation of FontFace API (#35262) 2025-02-19 05:50:01 +00:00
layout_thread_2020 script: add skeleton implementation of FontFace API (#35262) 2025-02-19 05:50:01 +00:00
malloc_size_of libservo: Convert intercept_web_resource_load into load_web_resource (#35564) 2025-02-21 14:36:42 +00:00
media libservo: Move GL acclerated media setup out of RenderingContext and simplify it (#35553) 2025-02-20 13:52:18 +00:00
metrics script_traits: Rename ConstellationControlMsg to ScriptThreadMessage (#35226) 2025-01-30 22:46:17 +00:00
net Don’t prompt user for credentials for non-Navigate request (#35664) 2025-02-26 03:52:00 +00:00
pixels pixels: Fix webp detection (#35474) 2025-02-19 11:09:16 +00:00
profile Improve scheduling of the memory profiler. (#35618) 2025-02-23 20:04:57 +00:00
rand
range
script bindings: Fix support for interface members in setlike/maplike. (#35651) 2025-02-27 07:04:11 +00:00
script_bindings bindings: Fix support for interface members in setlike/maplike. (#35651) 2025-02-27 07:04:11 +00:00
servo winit_minimal: fix build breakage (#35686) 2025-02-27 04:52:29 +00:00
shared libservo: Clean up interfaces for alert()/confirm()/prompt() (#35579) 2025-02-27 02:49:08 +00:00
timers deps: Remove some unused Cargo.toml (#35466) 2025-02-14 15:33:14 +00:00
url
webdriver_server libservo: Move WebDriver messages to the embedder crate (#35602) 2025-02-24 13:57:28 +00:00
webgpu chore: Update wgpu (#35639) 2025-02-24 20:27:36 +00:00
webxr script: Fix typo in ScriptThread::process_pending_input_events (#35627) 2025-02-24 15:58:05 +00:00