[Bug 27016] [Custom]: Custom element constructor behavior makes no sense

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27016

--- Comment #2 from Boris Zbarsky <bzbarsky@mit.edu> ---
You're not defining the [[Construct]].

You're defining part of the [[Call]] of the Web IDL constructor, which doesn't
have a useful context object as Web IDL is specified right now.  In particular,
the "this" value when the [[Call]] is invoked in this case is some random JS
object (the one the default [[Construct]] allocated), not an Element instance.

In particular, the relevant part of Web IDL is step 5 of the [[Call]] internal
method of interface objects, which does:

 5. Let R be the result of performing the actions listed in the description of
    constructor with values as the argument values. 

and what you're doing is providing said list of actions. Which means its result
needs to be R (in this case the Element).

Once ES6 gets its @@create/whatever story in order and Web IDL is updated
accordingly we'll see what custom elements needs to say here to sync up with
that.  But for now what it says is nonsensical, sorry.  It needs to be actually
creating the element it wants to return from [[Call]].

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 10 October 2014 16:42:41 UTC