Re: appendChild exception missing from standard

Have you read section 1.4 in the DOM specification level 3, which I believe
to some extent has been in all versions:

"Implementations should raise other exceptions under other circumstances.  For
example, implementations should raise an implementation-dependent exception if
a null argument is passed when a null was not expected"

There are, clearly, any number of things you could pass to any of the functions
for which the results are not completely defined.  The specification does not
define behavior for each possible illegal input.

I suggest more careful reading of the specification.  Talk about what the
specification says on the topic, not just that you were surprised by it now
that you have someone worrying about it.  Those who attended the many meetings
where these things were discussed did not completely miss the issue.  There were
reasons why these particular things were kept implementation-dependent.  I am
sorry it was not convenient for you to raise the issue during the many years
when active participation and feedback in the group was being solicited, so
that you could have some ownership in the current set of standards.

Ray Whitmer


On Sun, 10 Sep 2006, Hallvord R. M. Steen wrote:

>
> http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-184E7107
> doesn't say what exception appendChild should throw on invalid input
> (such as null or a string). A while ago we at Opera realised that pretty much
> everyone else throws an exception that isn't in the spec, (learnt the hard 
> way since
> not doing so broke Google Reader..) so I suggest the spec is updated to cover 
> exceptions due to arguments that are not nodes or document fragments.
>
> (This is also relevant for other DOM functions like replaceChild)
>
> -- 
> Hallvord R. M. Steen
> Core QA JavaScript tester, Opera Software
> http://www.opera.com/
> Opera - simply the best Internet experience
>

Received on Monday, 11 September 2006 09:39:52 UTC