-
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
html/webappapis/scripting/event-loops/fully_active_document.window.js
doesn't pass anywhere and has wrong assertions
#49948
Comments
@gterzian You wrote this test—any thoughts on how to proceed? |
I think it makes more sense if you look at the other files involved, see https://github.com/servo/servo/pull/22802/files, and at the example in https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active-documents
Regarding the behavior of |
@gterzian so how come this doesn't pass in any browser? No browser implements this part of the spec? Perhaps the spec needs to be changed? |
This I don't know, you'd have to ask the relevant persons. From a quick look in Gecko, I don't see anything that would throttle the task as specified(but I may be missing something). I speculate it's either because browsers don't queue a task, and instead fire an event then and there, or because they don't throttle the task. But for the Gecko example above, it's hard to tell how it relates exactly to the spec, which is pretty clear(queue a task, which implies it only runs if the document is fully active, and in the task fire an event).
Maybe, but I would first like the ascertain whether the logic above is correct at all. Then the question is whether browsers implement this consistently differently, and that this is the intended goal, or whether the spec itself is actually "right", and no one follows it but they should(perhaps because it shows the need to not have different implementations of event-loop and task queues that all differ from the spec in their own unique ways). I think besides |
I don't see where "fully active" is specified in this way. See https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active-documents A Document d is said to be fully active when d is the active document of a navigable navigable, and either navigable is a top-level traversable or navigable's container document is fully active. Based on this definition I don't see how a fully-active document can have a child iframe with a document that's active but not fully active. |
I would say it's rather a grand child iframe. The In the test, |
This assumes that I debugged the test on chrome and indeed the iframe unloads and the document is destroyed. |
Thanks for looking into it. So I guess this depends on "Let And if destroyed, the task firing the storage event is also removed from the task queue, so the storage event is never received. So the test makes an assumption about the iframe being cached for history traversal. But, the |
I think this becomes a test that checks how the event loop behaves with BFCache, so this should follow what other Do you intend to work on this? Perhaps remove this test and submit a valid test when you're ready? Note that the |
Yes I think the test could be re-written using something like But before doing so, it would be good to ascertain whether broadcasting these storage events to documents in the cache(or rather, when they are navigated out of it again) is desirable. There is an open discussion about this for broadcast channels, with browsers showing inconsistent behavior. So I've asked a question at whatwg/html#7253 (comment) I think it's fine to remove the test for now. |
I don't really understand this test.
Especially https://github.com/web-platform-tests/wpt/blob/master/html/webappapis/scripting/event-loops/fully_active_document.window.js#L11 - why is the iframe not "fully active" here? You've just now waited for it to fully load.
Perhaps this test can be somehow simplified, and in a way that passes in any browser? Otherwise we should remove it.
@jdm can you take a look?
The text was updated successfully, but these errors were encountered: