Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document.registerElement('foo', {extends: undefined}) fails #462

Closed
johnjbarton opened this issue Apr 1, 2014 · 3 comments
Closed

document.registerElement('foo', {extends: undefined}) fails #462

johnjbarton opened this issue Apr 1, 2014 · 3 comments

Comments

@johnjbarton
Copy link

In a page with

<polymer-element name="code-mirror" attributes="value mode theme tabSize lineNumbers"></polymer-element>

Try

var XFooPrototype = Object.create(HTMLElement.prototype);
XFooPrototype.createdCallback = function() {
  this.textContent = "I'm an x-foo!";
};
XFooPrototype.foo = function() {
  console.log('foo() called');
};

var XFoo = document.registerElement('polymer-element', {extends: undefined,
  prototype: XFooPrototype
});

The textContent will not update because the createdCallback is never called. Should work or throw.

@dfreedm
Copy link
Member

dfreedm commented Apr 1, 2014

Should be var XFoo = document.registerElement('code-mirror', ... )

@arv
Copy link
Contributor

arv commented Apr 1, 2014

Should have been fixed by googlearchive/ShadowDOM@4a630bc

@johnjbarton
Copy link
Author

could be, i've not updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants