No subject


Tue May 3 15:05:30 PDT 2016


-- 
You are receiving this mail because:
You are the assignee for the bug.

--Boundary_(ID_XyDO3kWLS1aGzfJCqzspiQ)
Date: Thu, 16 Mar 2017 16:07:10 -0700
MIME-version: 1.0
Content-type: text/html
Content-transfer-encoding: 7BIT

<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <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#c3">Comment # 3</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#c2">comment #2</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=169789#c1">comment #1</a>)
&gt; &gt; (In reply to <a href="show_bug.cgi?id=169789#c0">comment #0</a>)
&gt; &gt; &gt; The newly-introduced test at
&gt; &gt; &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; &gt; &gt; beforeunload-canceling.html named
&gt; &gt; &gt; 
&gt; &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; &gt; 
&gt; &gt; &gt; does not pass in Safari Tech Preview 25. Everything else does (except the
&gt; &gt; &gt; test &quot;Returning a string must not cancel the event: BeforeUnloadEvent with
&gt; &gt; &gt; type &quot;click&quot;, cancelable&quot; which is fine since it's best if Safari doesn't
&gt; &gt; &gt; implement createEvent(&quot;beforeunload&quot;); see
&gt; &gt; &gt; <a href="https://github.com/whatwg/dom/issues/362">https://github.com/whatwg/dom/issues/362</a>.)
&gt; &gt; 
&gt; &gt; I am not clear yet on what part of the spec says so.
&gt; &gt; 
&gt; &gt; I found:
&gt; &gt; <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)
&gt; &gt; 
&gt; &gt; which says:
&gt; &gt; If return value is not null, then:
&gt; &gt;     1. Set E's canceled flag.
&gt; &gt;     ...
&gt; &gt; 
&gt; &gt; So if you return false, we cancel the event.
&gt; 
&gt; Oh, it is a CustomEvent, not a BeforeUnloadEvent. I get it now.</span >

So:

&quot;&quot;&quot;
Otherwise
If return value is false, then set E's canceled flag.

If we've gotten to this &quot;Otherwise&quot; clause because E's type is beforeunload but E is not a BeforeUnloadEvent object, then return value will never be false, since in such cases return value will have been coerced into either null or a DOMString.
&quot;&quot;&quot;



More information about the webkit-unassigned mailing list