Error thrown when passing a custom element's shadowRoot to Node.isSameNode (FF 60, Chrome 46). While the current DOM spec doesn't mandate throwing an error when a non-Node is passed to isSameNode, these browser versions do throw. And it looks like the wc polyfills are creating a synthetic shadowRoot object that is not an instance of Node.
I came across this issue when using the @spectrum-web-components/tooltip package, but I isolated it down to the root cause.
I'm logging this issue because I couldn't find any record of the issue online. Please advise if these browser versions are outside of the supported browser range. The readme is a little unclear about what the compatibility matrix includes, and the "current versions" statement is relative to the time it was written, which I don't know.
Error is thrown:
Firefox 60: TypeError: Argument 1 of Node.isSameNode does not implement interface Node.
Chromium 46: TypeError: Failed to execute 'isSameNode' on 'Node': parameter 1 is not of type 'Node'
Version
@webcomponents/webcomponentsjs@2.5.0
Browsers affected
[x] Chrome (46)
[x] Firefox (60, 52, and earlier)
[ ] Edge
[ ] Safari
[ ] IE 11
Note: the issue no longer appears in at least Firefox 68 and Chrome 57.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description
Error thrown when passing a custom element's shadowRoot to
Node.isSameNode
(FF 60, Chrome 46). While the current DOM spec doesn't mandate throwing an error when a non-Node is passed to isSameNode, these browser versions do throw. And it looks like the wc polyfills are creating a synthetic shadowRoot object that is not an instance ofNode
.I came across this issue when using the
@spectrum-web-components/tooltip
package, but I isolated it down to the root cause.I'm logging this issue because I couldn't find any record of the issue online. Please advise if these browser versions are outside of the supported browser range. The readme is a little unclear about what the compatibility matrix includes, and the "current versions" statement is relative to the time it was written, which I don't know.
Thanks
Example
https://output.jsbin.com/nedafux
Steps to reproduce
my-element
document.body.isSameNode(this.shadowRoot)
my-element
to document.bodyExpected behavior
There should be no error thrown.
Actual behavior
Error is thrown: Firefox 60:
TypeError: Argument 1 of Node.isSameNode does not implement interface Node.
Chromium 46:TypeError: Failed to execute 'isSameNode' on 'Node': parameter 1 is not of type 'Node'
Version
@webcomponents/webcomponentsjs@2.5.0
Browsers affected
Note: the issue no longer appears in at least Firefox 68 and Chrome 57.