On Oct 6, 2014, at 10:21 AM, Jarek Foksa <[email protected]> wrote: >> On 2014-10-06, at 18:24, James M. Greene <[email protected]> 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
