[whatwg] Web DOM Core feedback
Aryeh Gregor
Simetrical+w3c at gmail.com
Thu Jan 13 13:05:54 PST 2011
Various IDLs in the spec use [NoNull], but apparently WebIDL no longer
defines that (the Changes section says it was removed in 2008). I'm
not sure exactly what it used to do, but the spec should be updated to
use whatever WebIDL now defines as a replacement.
In defining the interface for Node, some of the attributes are defined
like "The parentElement attribute must return the parent node of the
context node if there is a parent and it is an Element node, or null
otherwise." while others are defined like
"""
The parentNode attribute must run these steps:
1. If the context node does not have a parent node, return null and
terminate these steps.
2. Return the parent node of the context node.
"""
They seem to be equivalent, but the first way is shorter.
There are a bunch of places where it says "When invoked with the same
argument the same NodeList object may be returned as returned by an
earlier call." Shouldn't this be either required or prohibited in any
given case, not left undefined?
The NodeList interface doesn't specify its supported property indices,
which WebIDL requires. Since you return null instead of throwing
TypeErrors for out-of-range indices, I guess that you want to say that
all indices are supported. (Maybe the WebIDL spec should be changed
to make this the default if supported property indices aren't
specified?)
The HTMLCollection interface does specify supported property indices,
but then also specifies behavior for out-of-bounds values which seems
to conflict with WebIDL (returns null instead of throwing). Same for
DOMStringList, DOMTokenList, and possibly others. Again, maybe it's
WebIDL that should actually change here, not sure.
More information about the whatwg
mailing list