Automatically generate CONTENT_EVENT_HANDLER_NAMES from WebIDL#43848
Conversation
|
🔨 Triggering try run (#23873698923) for Linux (WPT) |
|
Test results for linux-wpt from try job (#23873698923): Flaky unexpected result (27)
Stable unexpected results that are known to be intermittent (18)
Stable unexpected results (2)
|
|
|
|
Hi @jdm Should I change my code generator so it only looks at two specific event lists, instead of looking at every possible interface? |
|
Yeah, that might be more clear if we're only ever getting handler names from a small number of webidl files. |
|
Although then again, the onwaitingforkey comes from HTMLMediaElement, and the purpose of this change was to avoid manually updating this list as new features get implemented. |
b4c6321 to
0cf4dd8
Compare
|
The list is now filtered by HTMLElement/SVGElement inheritance instead of Node. onreadystatechange is excluded and onwaitingforkey will be included once its WebIDL is added |
|
We do want onreadystatechange, though— |
|
Oh wait, maybe I misunderstood the test failure. I'll run a WPT run quickly. |
|
🔨 Triggering try run (#23909384549) for Linux (WPT) |
|
Test results for linux-wpt from try job (#23909384549): Flaky unexpected result (34)
Stable unexpected results that are known to be intermittent (21)
Stable unexpected results (1)
|
|
|
|
You can use |
0cf4dd8 to
0b90adf
Compare
|
Once you siign your commit with |
Thank you |
Signed-off-by: staysafe020 <jambongralpher@gmail.com>
0b90adf to
a078fcd
Compare
|
@jdm i have signed the commit |
Replaced the hand-written CONTENT_EVENT_HANDLER_NAMES list in eventtarget.rs with an auto-generated version. A new ContentEventHandlerNames method in codegen.py iterates through WebIDL descriptors whose prototype chain includes Node, collects attribute members with EventHandler callback types, and generates a sorted, duplicate free Rust array. The list is included from eventtarget.rs eliminating manual maintenance and ensuring it stays in sync automatically.
Testing: Build passes with cargo build -j2 -p servo-script. The generated ContentEventHandlerNames.rs produces the same set of event handler names as the previous hand-written list. No new runtime tests are needed since this is a compile time change.
Fixes: #43611