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

[0.8] HTMLAnchor has a host property, breaks the intended behavior of Polymer.Base._queryHost #1359

Closed
cdata opened this issue Apr 2, 2015 · 3 comments
Labels

Comments

@cdata
Copy link
Contributor

cdata commented Apr 2, 2015

Polymer.Base._queryHost attempts to resolve a host node by walking through DOM ancestors and measuring their host properties. Unfortunately, HTMLAnchor has a built-in host property that is the hostname component of its href property, if available. This has the unfortunate side-effect of causing a runtime exception if a Polymer custom element is wrapped with an HTMLAnchor in ShadeyDOM mode.

@cdata cdata added the 0.8 label Apr 2, 2015
@IntranetFactory
Copy link

I got the following error in ready.html, line 87

Uncaught TypeError: Cannot read property 'push' of undefined

I think that's the same problem as mentioned above. As a workaround I changed _queryHost to

    _queryHost: function (node) {
      if (node && node.host && node.constructor.name == "HTMLAnchorElement") node = Polymer.dom(node).parentNode;
      return node &&
        (node.host || (node.host = this._queryHost(Polymer.dom(node).parentNode)));
    },

@IntranetFactory
Copy link

I think that #1372 solved this issue, at least for me.

@sorvell
Copy link
Contributor

sorvell commented May 22, 2015

Fixed in version 0.9.

@sorvell sorvell closed this as completed May 22, 2015
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

3 participants