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 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)
The reason this is not changed is because we have new Document() these days.
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);
Could you list the others? hasFeature is not done because the feature should not be used.
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.
For Document issue see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22960
(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.
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?
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.
https://github.com/whatwg/dom/commit/b6354d791f9998540a8de929da747f3945b005ff