This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27460 - Notes: handled/not handled in onerror wrong?
Summary: Notes: handled/not handled in onerror wrong?
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#runtime...
Whiteboard: [good first bug]
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-28 10:36 UTC by contributor
Modified: 2016-02-23 17:49 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2014-11-28 10:36:14 UTC
Specification: https://html.spec.whatwg.org/multipage/webappapis.html
Multipage: https://html.spec.whatwg.org/multipage/#runtime-script-errors
Complete: https://html.spec.whatwg.org/#runtime-script-errors
Referrer: https://html.spec.whatwg.org/multipage/

Comment:
handled/not handled in onerror wrong?

"If event was canceled, then the error is handled. Otherwise, the error is not
handled."

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3319
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3320

I think "return false" means the event is canceled, but at least
Blink/WebKit/Gecko report the error to the console. (And do not report to the
console for "return true".)

Posted from: 90.230.218.37 by simonp@opera.com
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.62 Safari/537.36 OPR/26.0.1656.20 (Edition beta)
Comment 1 Ian 'Hixie' Hickson 2014-12-01 19:14:55 UTC
'true' cancels, for 'error' events:

https://html.spec.whatwg.org/multipage/webappapis.html#the-event-handler-processing-algorithm
Comment 2 Simon Pieters 2014-12-02 10:49:17 UTC
OK. I didn't find that when looking for it. :-)

Could you add a note about this in step 15 of https://html.spec.whatwg.org/multipage/webappapis.html#runtime-script-errors ?
Comment 3 Ian 'Hixie' Hickson 2014-12-03 19:54:15 UTC
Yeah, good idea.
Comment 4 rits 2016-02-23 08:24:22 UTC
"return true is canceled for "error" events, hence do not report error to console."
is this fine?
Comment 5 Anne 2016-02-23 09:14:34 UTC
I think it would be better to reference the "the event handler processing algorithm" directly using <span data-x=""> in the note. I.e.,

  <p class="note">Returning true cancels <var>event</var> per <span data-x="...">the event handler ...</span>.</p>
Comment 6 Anne 2016-02-23 17:49:10 UTC
https://github.com/whatwg/html/pull/725