Bug 219102

Summary: [iOS] beforeunload event does not fire in MobileSafari
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: REOPENED ---    
Severity: Normal CC: achristensen, darin, ews-watchlist, ggaren, japhet, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch none

Description Chris Dumez 2020-11-18 11:35:14 PST
beforeunload event does not fire in MobileSafari on iOS. This is inconsistent with the HTML specification and with Safari on macOS. It is therefore confusing for Web developers that this event does not fire.
Comment 1 Chris Dumez 2020-11-18 11:35:24 PST
Comment 2 Chris Dumez 2020-11-18 11:50:45 PST
Created attachment 414464 [details]
Comment 3 Geoffrey Garen 2020-11-18 11:54:48 PST
Comment on attachment 414464 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=414464&action=review


> Source/WebCore/ChangeLog:9
> +        MobileSafari on iOS does implement WKUIDelegate's runJavaScriptAlertPanelWithMessage because

does not

> Source/WebCore/ChangeLog:16
> +

Might be worth mentioning that iOS already fires the unload event, so running an event at this time is not a significant change in policy.
Comment 4 Chris Dumez 2020-11-18 11:56:46 PST
Created attachment 414466 [details]
Comment 5 Chris Dumez 2020-11-18 12:44:43 PST
Created attachment 414470 [details]
Comment 6 EWS 2020-11-18 13:57:25 PST
Committed r269983: <https://trac.webkit.org/changeset/269983>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 414470 [details].
Comment 7 Chris Dumez 2020-12-08 15:54:46 PST
Reverted r269983 for reason:

Seems to have regressed PLT5

Committed r270560: <https://trac.webkit.org/changeset/270560>