W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: [DOMCore] [NoNull] annotation is not defined by WebIDL anymore

From: Cameron McCormack <cam@mcc.id.au>
Date: Sat, 21 May 2011 10:51:56 +1200
To: David Flanagan <dflanagan@mozilla.com>
Cc: www-dom@w3.org
Message-ID: <20110520225155.GA27813@wok.mcc.id.au>
Hi David.

David Flanagan:
> The current DOM Core draft uses the [NoNull] annotation for
> insertBefore(), replaceChild(), removeChild() and appendChild().
> But [NoNull] is no longer defined by WebIDL, apparently replaced by
> [TreatNullAs=...]

My plan is to resolve
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10640 by making interface
types by default not include null, and to require a nullable type if you
do want to allow null.  Thus you’d have

  Node appendChild(in Node n);

because you don’t want to allow null to be passed in, and

  readonly attribute Node? parentNode;

because that attribute can be null.

> More generally, both the DOM and WebIDL are vague about how null
> arguments are to be handled, and as near as I can tell, this is left
> up to the implementation.

My current thinking is to make this case throw a TypeError.

[TreatNullAs] is just for handling DOMStrings, btw.

Cameron McCormack ≝ http://mcc.id.au/
Received on Friday, 20 May 2011 22:52:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:17 UTC