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 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.
Thanks
Example
https://output.jsbin.com/nedafux
Steps to reproduce
- Create
my-element
- In the constructor, create a shadow root (open).
- Call
document.body.isSameNode(this.shadowRoot)
- Append
my-element to document.body
- Load the page with Firefox 60 or Chromium 46
- See the error in the console.
Expected 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.
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/tooltippackage, 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-elementdocument.body.isSameNode(this.shadowRoot)my-elementto 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.