<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - onbeforeunload event return value coercion is not per-spec"
href="https://bugs.webkit.org/show_bug.cgi?id=168382">168382</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>onbeforeunload event return value coercion is not per-spec
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari Technology Preview
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>macOS 10.12
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>Page Loading
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>d@domenic.me
</td>
</tr>
<tr>
<th>CC</th>
<td>beidson@apple.com
</td>
</tr></table>
<p>
<div>
<pre>Test: <a href="http://w3c-test.org/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html">http://w3c-test.org/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html</a>
Spec: <a href="https://html.spec.whatwg.org/#the-event-handler-processing-algorithm">https://html.spec.whatwg.org/#the-event-handler-processing-algorithm</a> step 4
The return value of an onbeforeunload event handler is supposed to be coerced to a DOMString?, and then any non-null value should cancel the event. That means anything but null or undefined should cancel the event. Safari Tech Preview seems to not cancel when returning "" or true or 0.</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>