-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Enable shadowrealm testing for dom events api #41966
base: master
Are you sure you want to change the base?
Enable shadowrealm testing for dom events api #41966
Conversation
Let's block on this as per #41985. |
The non-ShadowRealm version of these tests rely on document.createEvent() which is not exposed in ShadowRealms. Add separate tests for ShadowRealm scopes that use the Event constructor instead of document.createEvent(). For the cancelBubble test, we cannot actually test the bubbling behaviour without a DOM, but the property still must exist. Also, make sure to expose the export on globalThis in the support script.
This adds a copy of the test in Event-propagation.html, but on a plain EventTarget instead of a DOM node. The difference is that EventTarget doesn't have bubbling/capture behaviour, so the expectations after stopPropagation() and cancelBubble=true are different. This test can be run in every global scope where EventTarget is available, not just in ShadowRealm.
Add assertion messages, fix typo. These are here because I've added additional variants of these tests for ShadowRealm and have made the same changes in the new tests.
b5ac50c
to
cd8e252
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add a bunch of copies of .html
files instead of turning those into .any.js
tests? (And ideally turning them into .any.js
files would happen in a separate PR.)
@annevk Sure, I can do that. I did it this way initially, because I assumed we'd still want to keep the existing test coverage of events being created with |
Tests that cannot be generalized should be kept. They could potentially be moved to a |
This is done in #49211. |
No description provided.