Skip to content

[Navigation API] Inconsistency between spec and tests for navigating methods and detached iframes #11252

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

Closed
jnjaeschke opened this issue Apr 23, 2025 · 1 comment

Comments

@jnjaeschke
Copy link

What is the issue with the HTML Standard?

While implementing the navigation methods in Gecko it turned out that some test expectations do not match the specification expectations (if I understood everything correctly :) ).

Take this test as an example:

The test performs a navigation on a detached iframe. The navigation should fail, and according to the test it should return rejected promises containing the DOM exception.

However, since the iframe is detached, it is not fully active, which means that promises in the iframe's realm do not run.

Therefore, according to the spec, the mentioned test should time out. However, in Chrome the test passes.

cc @smaug---- @zcorpan @farre @domenic

@domenic
Copy link
Member

domenic commented Apr 25, 2025

This is a classic issue. #2621 is probably the main discussion; #4443 is slightly related.

which means that promises in the iframe's realm do not run.

This isn't quite right. As pointed out in #2621 (comment) , the realm that is checked (i.e. the realm passed to HostEnqueuePromiseJob) is the realm of the handler function (i.e. in promise.then(fulfillHandler, rejectHandler). This follows from the JS spec's NewPromiseReactionJob definition.

In the tests you're linking to, the handlers are created in the outer realm. (By the code in testharness.js.) So they should still run.

Let me close this as I believe there's no conflict here. In fact, I feel like we can close #2621...

Of course, if I've missed something, I am happy to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants