New issue
Advanced search Search tips

Issue 873683 link

Starred by 3 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Pass the web-platform-test: beforeunload-synchronous.html

Reported by m...@mikepennisi.com, Aug 13

Issue description

A test for the synchronicity of the "beforeunload" event was recently accepted into WPT [1]. Chrome current fails this test in violation of the specification.

Chrome Version       : 68.0.3440.75
UserAgentString: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/68.0.3440.75 Chrome/68.0.3440.75 Safari/537.36

Other browsers tested:

Chrome 68   | fail
Edge 17     | fail
Firefox 61  | pass
IE 11       | pass
Safari 11.1 | fail

[1] https://github.com/web-platform-tests/wpt/pull/12343

---

> The href attribute's setter must run these steps:
>
> 1. Parse the given value relative to the entry settings object. If that
>    failed, throw a TypeError exception.
> 2. Location-object-setter navigate to the resulting URL record. 

https://html.spec.whatwg.org/multipage/history.html#dom-location-href

> A Location object has an associated Location-object-setter navigate algorithm, which given a url, runs these steps:
>
> 1. If any of the following conditions are met, let replacement flag be unset; otherwise, let it be set:
>    - This Location object's relevant Document has completely loaded, or
>    - In the task in which the algorithm is running, an activation behavior is
>      currently being processed whose click event's isTrusted attribute is
>      true, or
>    - In the task in which the algorithm is running, the event listener for a
>      click event, whose isTrusted attribute is true, is being handled.
> 2. Location-object navigate, given url and replacement flag.

https://html.spec.whatwg.org/multipage/history.html#location-object-setter-navigate

> To Location-object navigate, given a url and replacement flag, run these steps:
>
>   1. The source browsing context is the responsible browsing context
>      specified by the incumbent settings object.
>   2. Navigate the browsing context to url, with the exceptions enabled flag
>      set. Rethrow any exceptions.
>
> If the replacement flag is set or the browsing context's session history
> contains only one Document, and that was the about:blank Document created
> when the browsing context was created, then the navigation must be done with
> replacement enabled.

https://html.spec.whatwg.org/multipage/history.html#location-object-navigate

To navigate a browsing context browsingContext to a resource resource, optionally with an exceptions enabled flag, the user agent must run these steps:

> 1. If resource is a URL, then set resource to a new request whose url is
>    resource.
> 2. If resource is a request and this is a reload-triggered navigation, then
>    set resource's reload-navigation flag.
> 3. If the source browsing context is not allowed to navigate browsingContext,
>    then:
>    [...]
> 4. If there is a preexisting attempt to navigate browsingContext, and the
>    source browsing context is the same as browsingContext, and that attempt
>    is currently running the unload a document algorithm, then return without
>    affecting the preexisting attempt to navigate browsingContext.
> 5. If the prompt to unload algorithm is being run for the active document of
>    browsingContext, then return without affecting the prompt to unload
>    algorithm.
> 6. If this is not a reload-triggered navigation, resource is a request,
>    resource's url equals browsingContext's active document's URL with exclude
>    fragments flag set, and resource's url's fragment is non-null, then
>    navigate to that fragment, with replacement enabled if this was invoked
>    with replacement enabled, and return.
> 7. Cancel any preexisting but not yet mature attempt to navigate
>    browsingContext, including canceling any instances of the fetch algorithm
>    started by those attempts. If one of those attempts has already created
>    and initialized a new Document object, abort that Document also.
>    (Navigation attempts that have matured already have session history
>    entries, and are therefore handled during the update the session history
>    with the new page algorithm, later.)
> 8. Prompt to unload the active document of browsingContext. If the user
>    refused to allow the document to be unloaded, then return.
>
>    If this instance of the navigation algorithm gets canceled while this step
>    is running, the prompt to unload algorithm must nonetheless be run to
>    completion.

https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate

> To prompt to unload, given a Document object document and optionally a
> recursiveFlag, run these steps:
>
> 1. Increase the event loop's termination nesting level by 1.
> 2. Increase the document's ignore-opens-during-unload counter by 1.
> 3. Let event be the result of creating an event using BeforeUnloadEvent.
> 4. Initialize event's type attribute to beforeunload and its cancelable
>    attribute true.
> 5. Dispatch: Dispatch event at document's Window object.

https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document
 
Components: Blink>PageLifecycle
Cc: susan.boorgula@chromium.org
Labels: Needs-Triage-M68 Needs-Feedback Triaged-ET
mike@ Thanks for the issue.

Request you to provide a sample test file/URl, actual and expected outputs, which will help us in further triaging of the issue.

Thanks..
Certainly:

http://w3c-test.org/html/browsers/browsing-the-web/unloading-documents/beforeunload-synchronous.html

That page should report 1 passing test (the word "PASS" should appear in the column labeled "Result"). In Chromium today, it reports 1 failing test.
Project Member

Comment 4 by sheriffbot@chromium.org, Sep 5

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: vamshi.kommuri@chromium.org
Labels: -Pri-3 Target-71 M-71 FoundIn-71 OS-Mac OS-Windows Pri-2
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on reported chrome version 68.0.3440.75 and on the latest canary 71.0.3562.0 using Windows 10, Ubuntu 14.04 and Mac 10.13.1

As the issue is seen from M60(60.0.3112.0) considering it as Non-Regression and marking it as Untriaged. Requesting the respective team to have a look into this issue.

Thanks!  

Sign in to add a comment