Bug 190090 - The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
Summary: The return value of an OnBeforeUnloadEventHandler should always be coerced in...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-28 14:13 PDT by Chris Dumez
Modified: 2018-09-28 19:04 PDT (History)
8 users (show)

See Also:


Attachments
Patch (10.87 KB, patch)
2018-09-28 14:27 PDT, 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 2018-09-28 14:13:09 PDT
The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString:
- https://html.spec.whatwg.org/#onbeforeunloadeventhandler
- https://html.spec.whatwg.org/#the-event-handler-processing-algorithm

In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is because the return value cannot be false at:
- https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case).
Comment 1 Chris Dumez 2018-09-28 14:27:45 PDT
Created attachment 351110 [details]
Patch
Comment 2 WebKit Commit Bot 2018-09-28 19:04:00 PDT
Comment on attachment 351110 [details]
Patch

Clearing flags on attachment: 351110

Committed r236633: <https://trac.webkit.org/changeset/236633>
Comment 3 WebKit Commit Bot 2018-09-28 19:04:01 PDT
All reviewed patches have been landed.  Closing bug.