- From: Jonas Sicking <jonas@sicking.cc>
- Date: Wed, 19 Mar 2008 09:12:21 -0700
- To: Travis Leithead <travil@windows.microsoft.com>
- CC: "Web APIs WG (public)" <public-webapi@w3.org>
Travis Leithead wrote: > Since this spec is presumably creating a language binding for JavaScript, (and assuming interface objects are Functions, as seen by Opera), then why does: > > var div = new HTMLDivElement(); > > produce a script error? > > Seems like a perfectly valid thing to do, essentially a shortcut to document.createElement('div') The problem is that this doesn't make sense for lots of interfaces. What does var a = new HTMLElement(); do for example? And while there might only be one object that implement HTMLDivElement right now, who's to say that is true in the future. As it so happens there are actually at least 2 objects in firefox that implement that interface, a HTML <div> and an XHTML <div> (they differ in case sensitivity handling), which one should be instantiated by your code? / Jonas
Received on Wednesday, 19 March 2008 16:13:51 UTC