Bug 190090

Summary: The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, darin, ggaren, rniwa, sam, webkit-bug-importer, youennf
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.