- From: Ryosuke Niwa <rniwa@apple.com>
- Date: Tue, 07 Oct 2014 14:43:08 -0700
- To: Jarek Foksa <jarek@foksa.name>
- Cc: "James M. Greene" <james.m.greene@gmail.com>, Matthew Robb <matthewwrobb@gmail.com>, "Takayoshi Kochi (?? ??)" <kochi@google.com>, public-webapps <public-webapps@w3.org>
On Oct 6, 2014, at 10:21 AM, Jarek Foksa <jarek@foksa.name> wrote: >> On 2014-10-06, at 18:24, James M. Greene <james.m.greene@gmail.com> wrote: >> This only thing about this approach that is slightly inconsistent with the rest of the Web Platform is assuming that the `this` context within the handler will be set to the element, rather than being forced to grab it via `event.target`. > > ES6 arrow functions are going to solve the problems with “this” scoping inside event handlers. > > Ideally I would prefer to have a constructor instead of createdCallback(), and “attach”, “detach” and “attributechange” events instead of the other lifecycle callbacks. The constructor idea was already discussed here for a long time [1], but if I understand correctly it wasn’t approved due to performance issues. For the record, we don't need "an approval" from anyone to use the constructor instead of createdCallback(). As far as I understand the matter, we have never reached a consensus on this matter because we, representatives of Apple, have explicitly endorsed createdCallback() meanwhile representatives from some browser vendors have not endorsed using the constructor for custom elements. - R. Niwa
Received on Tuesday, 7 October 2014 21:43:51 UTC