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

getOwnerRoot incorrect when queried after an element is added from within a documentFragment #3295

Closed
sorvell opened this issue Jan 14, 2016 · 0 comments
Assignees

Comments

@sorvell
Copy link
Contributor

sorvell commented Jan 14, 2016

This can happen when, for example, and element queries its owner root via Polymer.dom(this).getOwnerRoot() while it is inside a documentFragment like a dom-if. The owner root should be null in this case, but if the element is subsequently added to a root, the owner root should be updated. It does not, in this case because when the node is added, for performance reasons Polymer.dom avoids resetting owner roots inside this tree specifically if the tree is a documentFragment.

Alternatively, we can ensure that owner roots are never cached when an element is not in the document. This should be a better approach and maintain good performance.

@sorvell sorvell self-assigned this Jan 14, 2016
kevinpschaaf added a commit that referenced this issue Jan 19, 2016
Fixes #3295. Only cache a false-y result for an element's owner shady…
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

1 participant