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

Elements failing instanceof after WebComponentsReady #402

Closed
jyasskin opened this issue Jan 23, 2014 · 4 comments
Closed

Elements failing instanceof after WebComponentsReady #402

jyasskin opened this issue Jan 23, 2014 · 4 comments
Assignees
Labels

Comments

@jyasskin
Copy link

http://jeffrey.yasskin.info/dump/instanceof_test.html (code at https://gist.github.com/jyasskin/8575145) shows "Tag Name: CXX-FUNCTION; Instance of CxxFunctionElement: false" despite the element being registered with <polymer-element name="cxx-function" constructor="CxxFunctionElement" noscript>.

Oddly, copying the same code into a jsbin does not reproduce the problem. It has to run directly on a server. This is in Mac Chrome 34.0.1797.2 with none of the experimental flags turned on. On Canary with --enable-experimental-web-platform-features, the problem also doesn't happen, which makes me suspect the shadow dom polyfill wrapper objects.

@sjmiles
Copy link
Contributor

sjmiles commented Aug 18, 2014

Confirm behavior is different between Firefox and Chrome, although I don't know exactly what polyfill or interaction is the root cause.

@sorvell sorvell assigned jmesserly and unassigned sjmiles Aug 20, 2014
@sorvell
Copy link
Contributor

sorvell commented Aug 20, 2014

@jmesserly Would you mind taking a look at this? Thanks.

@jmesserly
Copy link
Contributor

this looks like it was fixed to me. I'm now seeing the same result on Chrome/Firefox using a local server. (CxxFunctionElement: true)

for what it's worth, I think domReady is the callback you're looking for:

      Polymer('cxx-section', {
          domReady: function() {
              var child = this.firstElementChild;
              this.tag_name = child.tagName;
              this.instance = child instanceof CxxFunctionElement;
          },
      });

docs here: http://www.polymer-project.org/docs/polymer/polymer.html#lifecyclemethods

@jmesserly
Copy link
Contributor

tentatively going to close assuming this is fixed, let me know if you see it crop up again. Cheers!

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

No branches or pull requests

4 participants