Skip to content

beforeunload seems not to be firing on iframe.src=... in several WPT html/webappapis/dynamic-markup-insertion/opening-the-input-stream tests #25098

Open

Description

@pshaughn

#25094 #25095 #25096 all have some failures testing unload and pagehide events, but also time out as though beforeunload isn't even firing for them in the first place. In each case, the action that starts the unload process is assignment to the iframe's src.

Activity

  1. added
    A-content/dom
    on Dec 5, 2019
  2. pshaughn commented on Dec 22, 2019

    @pshaughn
    ContributorAuthor

    #20329 looks like it added everything necessary for the beforeunload event to fire. I don't yet know how these cases are going around that code and reaching unload, and I'm going to try to find out.

  3. pshaughn commented on Dec 22, 2019

    @pshaughn
    ContributorAuthor

    Every single document.unload in this test is called from ScriptThread::handle_unload_document, not Window::Close, and so the beforeunload code from #20329 is not applied.

    Upstream from ScriptThread::handle_unload_document is the ConstellationControlMsg::UnloadDocument message. This is sent from the chain of events that starts at HTMLIFrameElement::navigate_or_reload_child_browsing_context, which I don't understand well enough to diagnose anything about yet.

  4. pshaughn commented on Jan 1, 2020

    @pshaughn
    ContributorAuthor

    beforeunload should actually be firing much earlier; no network fetches should be initiated until after beforeunload has had a chance to fire and its return value has been examined. It seems to me like inside navigate_or_reload_child_browsing_context is a natural place to put it timing-wise, but I gather from IRC conversation with @jdm that there might be some complication about which origin/script thread can actually see the event at that time.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/dom

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions