W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2011

[whatwg] Web DOM Core feedback

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Thu, 13 Jan 2011 16:05:54 -0500
Message-ID: <AANLkTimcAGnWmMSsf6DuN0jKzrrXo24_f07kES8igzpu@mail.gmail.com>
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.
Received on Thursday, 13 January 2011 13:05:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:29 UTC