- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Mon, 15 Apr 2013 11:59:50 -0400
- To: Rick Waldron <waldron.rick@gmail.com>
- CC: Daniel Buchner <daniel@mozilla.com>, Scott Miles <sjmiles@google.com>, Allen Wirfs-Brock <allen@wirfs-brock.com>, John J Barton <johnjbarton@johnjbarton.com>, Dimitri Glazkov <dglazkov@google.com>, Rafael Weinstein <rafaelw@google.com>, public-webapps <public-webapps@w3.org>, Blake Kaplan <mrbkap@mozilla.com>, William Chen <wchen@mozilla.com>, Jonas Sicking <jonas@sicking.cc>, Steve Orvell <sorvell@google.com>, Dave Herman <dherman@mozilla.com>
On 4/15/13 10:45 AM, Rick Waldron wrote: > Sorry, I should've been more specific. What I meant was that: > > new HTMLButtonElement(); > > Doesn't construct an HTMLButtonElement, it throws with an "illegal > constructor" in Chrome and "HTMLButtonElement is not a constructor" in > Firefox (I'm sure this is the same across other browsers) Oh, I see. That's not anything inherent, for what it's worth; making this particular case work would be <10 lines of code. Less on a per-element basis if we want to do this for most elements. > function Smile() { > HTMLButtonElement.call(this); > this.textContent = ":)"; > } > > Smile.prototype = Object.create(HTMLButtonElement.prototype); Ah, so... This would not work even if "new HTMLButtonElement" worked, right? In particular, if HTMLButtonElement were actually something that could construct things in Gecko, it would still ignore its argument when called and always creates a new object. You can see the behavior with something like XMLHttpRequest if you want. > Hopefully that clarifies? Somewhat. Trying to understand what things we really need to support here and in what ways, long-term... -Boris
Received on Monday, 15 April 2013 16:00:25 UTC