Bug 189376

Summary: Ignore-opens-during-unload counter of a parent should apply to its children during beforeunload event
Product: WebKit Reporter: Timothy Gu <timothygu99>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, commit-queue, dbates, ews-watchlist, ggaren, japhet, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Timothy Gu 2018-09-06 14:37:42 PDT
Per https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document, the ignore-opens-during-unload counter of the document on which "prompt to unload" is called should stay incremented even as its descendants are being prompted for unload. This is the behavior of Firefox as well as Chrome 70+.

Test is available at https://github.com/web-platform-tests/wpt/blob/master/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js. In particular, the "document.open should bail out when ignore-opens-during-unload is greater than 0 during beforeunload event (open(parent) while unloading parent and child)" test currently fails.
Comment 1 Radar WebKit Bug Importer 2018-09-09 13:33:27 PDT
<rdar://problem/44282754>
Comment 2 Chris Dumez 2018-09-26 10:42:38 PDT
Created attachment 350870 [details]
Patch
Comment 3 WebKit Commit Bot 2018-09-26 12:30:02 PDT
Comment on attachment 350870 [details]
Patch

Clearing flags on attachment: 350870

Committed r236517: <https://trac.webkit.org/changeset/236517>
Comment 4 WebKit Commit Bot 2018-09-26 12:30:04 PDT
All reviewed patches have been landed.  Closing bug.