Open kalenikaliaksandr opened 11 months ago
Please assign this issue to me
I guess this depends on what time you believe "navigable's active window" is accessed, right? Is it accessed during step 12.6.7, when we're declaring the steps? (In which case we run into the problem you describe.) Or is it accessed at the time the steps are run? (In which case we get the new post-reload window.)
I would say that we generally treat these sorts of steps as "closures", so it closes over navigable, but the actual access of "navigable's active window" happens inside the steps and thus only at the time the steps are run.
Still, I guess we can make this a bit clearer.
I would say that we generally treat these sorts of steps as "closures", so it closes over navigable, but the actual access of "navigable's active window" happens inside the steps and thus only at the time the steps are run.
I might be missing something, but in this specific case, you always need to get an active window before the callback is queued on the event loop because it will define to which document the queued task belongs (global
parameter in https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task)
Responding to https://github.com/whatwg/html/pull/9901#issuecomment-1790112168
In Ladybird's implementation I ended up solving that by passing cloned active SHE into "populate session history entry" algorithm and then patching active SHE in unloading callback with all fields that could have been modified in "populate session history entry" (See https://github.com/SerenityOS/serenity/commit/91377f3ab98ba4e225295330220fcf5aad8f2f1b).
What is the issue with the HTML Standard?
There is a bug in the navigable's reload procedure.