servo/components/script_bindings/codegen
Simon Wülker 9d10e41a1a
Don't count <img> elements with both name and id twice in document's named getter (#37455)
A document's named getter collects elements with either matching name or
id's (varies per element type) and returns them .

We implement this the following way:
* Create an iterator with elements whose `name` attribute matches
* Create an iterator with elements whose `id` attribute matches
* Concatenate both

The spec then asks us if there is more than one element in the list,
which we implement by checking whether the iterator returns `None` after
we get the first element. However, the same element can appear in both
iterators if it is a `img` element and both it's name and id attribute
match. Therefore, we need to check if there are more elements *which are
not equal to the first one*.

Testing: New web platform tests pass

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-15 18:54:53 +00:00
..
api.html.template script: Move code generation and webidl files to new script_bindings crate. (#35157) 2025-01-24 20:47:43 +00:00
apis.html.template script: Move code generation and webidl files to new script_bindings crate. (#35157) 2025-01-24 20:47:43 +00:00
Bindings.conf Don't count <img> elements with both name and id twice in document's named getter (#37455) 2025-06-15 18:54:53 +00:00
CodegenRust.py Complete keyword list in CodegenRust.py (#37127) 2025-05-25 16:17:43 +00:00
Configuration.py Support static and instance members having the same name in IDLs (#36523) 2025-04-16 21:00:52 +00:00
interface.html.template script: Move code generation and webidl files to new script_bindings crate. (#35157) 2025-01-24 20:47:43 +00:00
property.html.template script: Move code generation and webidl files to new script_bindings crate. (#35157) 2025-01-24 20:47:43 +00:00
run.py Remove legacy layout (layout 2013) (#35943) 2025-03-13 07:26:57 +00:00