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 21826 - [Custom]: Describe what happens if element initialization throws an exception
Summary: [Custom]: Describe what happens if element initialization throws an exception
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18720
  Show dependency treegraph
 
Reported: 2013-04-25 08:43 UTC by Dominic Cooney
Modified: 2013-04-30 23:14 UTC (History)
0 users

See Also:


Attachments

Description Dominic Cooney 2013-04-25 08:43:46 UTC
The discussion of createElement, createElementNS says to "Run element initialization algorithm with the newly created element".

What happens if the ready callback raises an exception? Is that propagated to the caller of createElement?

These issues get trickier in places which plausibly do tree modification and run lifecycle callbacks, such as appendChild, but see bug 21825 seeking clarification on whether they do.
Comment 1 Dimitri Glazkov 2013-04-30 21:28:36 UTC
I am not sure what to do here. None of the specs that talk about callback mention anything special about exceptions being thrown inside those callbacks. Why should we be any different?
Comment 2 Dominic Cooney 2013-04-30 23:14:08 UTC
I thought about this more. You're right--errors are exceptional. I guess UAs can log them; if authors need to propagate them they can guard their ready callback with try/catch and log them on the element itself and require the caller to collect errors.