<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:cdumez&#64;apple.com" title="Chris Dumez &lt;cdumez&#64;apple.com&gt;"> <span class="fn">Chris Dumez</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - I found one more onbeforeunload event return value coercion edge case"
   href="https://bugs.webkit.org/show_bug.cgi?id=169789">bug 169789</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
               &nbsp;
           </td>
           <td>cdumez&#64;apple.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - I found one more onbeforeunload event return value coercion edge case"
   href="https://bugs.webkit.org/show_bug.cgi?id=169789#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - I found one more onbeforeunload event return value coercion edge case"
   href="https://bugs.webkit.org/show_bug.cgi?id=169789">bug 169789</a>
              from <span class="vcard"><a class="email" href="mailto:cdumez&#64;apple.com" title="Chris Dumez &lt;cdumez&#64;apple.com&gt;"> <span class="fn">Chris Dumez</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=169789#c0">comment #0</a>)
<span class="quote">&gt; The newly-introduced test at
&gt; <a href="http://w3c-test.org/html/browsers/browsing-the-web/unloading-documents/">http://w3c-test.org/html/browsers/browsing-the-web/unloading-documents/</a>
&gt; beforeunload-canceling.html named
&gt; 
&gt; &gt; Returning false must not cancel the event, because it's coerced to the DOMString &quot;false&quot; which does not cancel CustomEvents: CustomEvent, cancelable
&gt; 
&gt; does not pass in Safari Tech Preview 25. Everything else does (except the
&gt; test &quot;Returning a string must not cancel the event: BeforeUnloadEvent with
&gt; type &quot;click&quot;, cancelable&quot; which is fine since it's best if Safari doesn't
&gt; implement createEvent(&quot;beforeunload&quot;); see
&gt; <a href="https://github.com/whatwg/dom/issues/362">https://github.com/whatwg/dom/issues/362</a>.)</span >

I am not clear yet on what part of the spec says so.

I found:
<a href="https://html.spec.whatwg.org/#the-event-handler-processing-algorithm">https://html.spec.whatwg.org/#the-event-handler-processing-algorithm</a> (step 5)

which says:
If return value is not null, then:
    1. Set E's canceled flag.
    ...

So if you return false, we cancel the event.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>