-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract information on cancelability of events #1534
Conversation
now with test and updated schema |
This part looks good to me. I suppose the aggregation code still needs to be updated to add a |
thanks for the reminder re aggregation :) AFAICT cancelability is orthogonal to the target interface; in some cases, cancelability is not systematic, which this extraction doesn't capture, but it's not obvious to me that we can or should try to do so; I wouldn't try until we have a clear use case. |
The `cancelable` property is copied as-is by the post-processor, which should be what we want.
In theory, specs could set or unset the `cancelable` property of a given event differently whenever they fire the event. In practice, the cancelability of an event does not depend on the firing conditions. In other words, whenever a spec fires a given event, its `cancelable` property should always be the same. That assumption seems true today. To ease debugging in case that changes in the future, this update makes the extraction code report an error to the log when it bumps into discrepancies for the `cancelable` property. (Of course, ideally, we would have a better mechanism to report such extraction problems than hiding them in the log...)
In practice, if we consider that cancelability is an intrinsic property of an event, the aggregation logic does not need to change. It already copies the I also adjusted the extraction logic to report an error to the log if it finds the same event twice in a spec with different Now, one last thing I'm wondering about is the nuance between When I run this code against the Presentation API, it tells me that the spec defines a But then when a spec uses a "fire an event" phrasing without specifying anything, the created event will not be cancelable (unless a spec one day decides to change Maybe we don't really care as the most interesting case is probably to know when an event is cancelable. Running the crawler locally with this update, I see 74 |
The |
New feature: - Extract information on cancelability of events (#1534) Note the events extracts (and the consolidated `events.json` file) gain a new `cancelable` property with this change. Dependencies bumped: - Bump puppeteer from 22.6.3 to 22.6.5 (#1543) - Bump rollup from 4.14.1 to 4.14.3 (#1544) - Bump ajv-formats from 2.1.1 to 3.0.1 (#1529) - Bump undici from 6.12.0 to 6.13.0 (#1539) - Bump web-specs from 3.7.1 to 3.8.0 (#1545)
This extracts the cancelability of all actually-cancelable events listed in #772 (comment), except for the copy/cut/paste events which would need a patch (the same way they need one for bubbling), and for dblclick (due to a bug in the spec)
I've also verified that all the events that get extracted as cancelable are indeed marked as such in the source spec.
I don't know of a good way to check that it's not missing other cancelable events.
This is in the context of https://github.com/orgs/mdn/discussions/665#discussioncomment-9008930
This doesn't have test, nor does it update the aggregation/validation code, hence marking it as draft (happy for someone else to take a stab at those :)