This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
For various DOM Core methods it would be nice if method arguments could be annotated with "cannot be null" or some such and when annotated as such the binding would describe a language-specific exception to be thrown. I will use [NoNull] for now.
Maybe the sense should be reversed. Annotate when a null value is allowed.
That could work too. For DOMString (and boolean, etc.) we have DOMString? to indicate it can also be null. Maybe this should just apply to everything instead of just primitives.
I think this is a good idea, and using the same "nullable" syntax seems sensible. So: interface Node { // Can't pass in null, and null will never be returned. Node appendChild(in Node newChild); // parentNode can be null. readonly attribute Node? parentNode; ... }; This change likely affects everyone using Web IDL, though, so I'll leave some time for objections first.
Done: http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.269;r2=1.270;f=h
I'm really not looking forward to having to change all six quintillion occurrences of this in the IDLs in Web Apps 1.0. Any chance we could change this to Object! rather than Object?, with the meaning "null not allowed"?
I would have expected there to be fewer instances of "?" to add than "!". If you don't have time, I can run through the spec to verify this, and give you a diff if you want.
http://krijnhoetmer.nl/irc-logs/whatwg/20110602#l-119
Going through the Web Applications spec today, I find around 1000 instances of types that could be made nullable and around 350 instances where you would need to do so, or only around 80 if you don't count the "Function"s for event listener attributes. I therefore think it makes sense to do this, rather than invert the meaning and use "!" to exclude null. I will work on a patch for this.
Created attachment 996 [details] patch for Web Apps 1.0 This adds "?" where appropriate in the IDL fragments in the Web Apps 1.0 spec and removes a few prose requirements checking for null where the null would not get through the Web IDL requirements in the first place.
Back to Ian.
Dude you are the _king_. EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff given below (and above! thanks heycam!) Rationale: Concurred with reporter's comments.
Checked in as WHATWG revision r6220. Check-in comment: Update IDL to recent WebIDL changes, thanks to heycam. http://html5.org/tools/web-apps-tracker?from=6219&to=6220
mass-moved component to LC1
*** Bug 12724 has been marked as a duplicate of this bug. ***