Bug 219102 - [iOS] beforeunload event does not fire in MobileSafari
Summary: [iOS] beforeunload event does not fire in MobileSafari
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-18 11:35 PST by Chris Dumez
Modified: 2020-12-08 15:54 PST (History)
7 users (show)

See Also:


Attachments
Patch (6.24 KB, patch)
2020-11-18 11:50 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.37 KB, patch)
2020-11-18 11:56 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.38 KB, patch)
2020-11-18 12:44 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
<rdar://problem/70550655>
Comment 2 Chris Dumez 2020-11-18 11:50:45 PST
Created attachment 414464 [details]
Patch
Comment 3 Geoffrey Garen 2020-11-18 11:54:48 PST
Comment on attachment 414464 [details]
Patch

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

r=me

> 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]
Patch
Comment 5 Chris Dumez 2020-11-18 12:44:43 PST
Created attachment 414470 [details]
Patch
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>