Re: [Custom]: Rename "createdCallback" to "created"

I admittedly haven't been following the Custom Elements spec, so forgive if
my point of view has already been discussed and rejected but... I
definitely agree that this naming seems very inconsistent with the rest of
the Web Platform.

I would have expected to have these handlers configured via
`addEventListener` calls.  For example:

```js

var XFooPrototype = Object.create(HTMLElement.prototype);

XFooPrototype.addEventListener("create", function( /* event */ ) {
  this.textContent = "I'm an x-foo!";

  // OR:
  // event.target.textContent = "I'm an x-foo!";
};

XFooPrototype.foo = function() {
  console.log("foo() called");
};

var XFoo = document.registerElement('x-foo', {
  prototype: XFooPrototype
});

```

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`.

Even `XFooPrototype.oncreate = fn;` would be more consistent than
`XFooPrototype.create`, `XFooPrototype.created`, or
`XFooPrototype.createdCallback`.

The same thoughts also hold true for the other Custom Element lifecycle
hooks as well, of course.

Received on Monday, 6 October 2014 16:25:42 UTC