This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22959 - Nullable parameter in tail position should be optional
Summary: Nullable parameter in tail position should be optional
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 15:10 UTC by Erik Arvidsson
Modified: 2013-08-16 10:42 UTC (History)
5 users (show)

See Also:


Attachments

Description Erik Arvidsson 2013-08-14 15:10:47 UTC
For example:

http://dom.spec.whatwg.org/#domimplementation

XMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyString] DOMString qualifiedName, DocumentType? doctype);

It really is silly to force people to write createDocument(ns, 'root', null)
Comment 1 Anne 2013-08-14 15:51:27 UTC
The reason this is not changed is because we have new Document() these days.
Comment 2 Erik Arvidsson 2013-08-14 16:00:04 UTC
There are other cases. For example

boolean hasFeature(DOMString feature, [TreatNullAs=EmptyString] DOMString version);

would be better as

boolean hasFeature(DOMString feature, optional [TreatNullAs=EmptyString] DOMString version);
Comment 3 Anne 2013-08-14 16:08:15 UTC
Could you list the others? hasFeature is not done because the feature should not be used.
Comment 4 Erik Arvidsson 2013-08-14 16:22:43 UTC
I still think doctype should be optional in createDocument. createDocument is still used since new Document has other issues. I'll file a new bug about that.
Comment 5 Erik Arvidsson 2013-08-14 16:47:28 UTC
For Document issue see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22960
Comment 6 Erik Arvidsson 2013-08-14 17:39:08 UTC
(In reply to comment #3)
> Could you list the others? hasFeature is not done because the feature should
> not be used.

It is actually only hasFeature and createDocument that has this kind of signature.
Comment 7 Anne 2013-08-15 11:19:17 UTC
We could make it optional. But that doesn't make it optional in all browsers right away. It's not clear what the advantage is, other than it would more closely align with Chrome / Safari and less with Gecko / IE for the foreseeable future.

Given that both Gecko / IE implement IDL (as I understand) making createDocument()'s arguments optional could be pretty trivial however and maybe that's okay with Olli and Travis?
Comment 8 Olli Pettay 2013-08-15 14:19:42 UTC
I would not change hasFeature, just because it shouldn't be used at all.
But making the last param of createDocument optional sounds ok to me.