Skip to content

Elements failing instanceof after WebComponentsReady #402

Description

@jyasskin

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.

Activity

  1. sjmiles commented on Aug 18, 2014

    @sjmiles
    Contributor

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

  2. sorvell commented on Aug 20, 2014

    @sorvell
    Contributor

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

  3. jmesserly commented on Aug 29, 2014

    @jmesserly
    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

  4. jmesserly commented on Aug 29, 2014

    @jmesserly
    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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions