Open elchininet opened 11 months ago
Hi @domenic,
Just to report that after the inclussion of dom-selector this issue seems to be fixed, the selection with :host
doesn‘t throw an error and it selects the proper element (it keeps failing with version 23.1.0
). You can close the issue if you prefer or let it open if you want to write some tests to cover it.
Regards
Thanks for the report! Our plan is to keep this (and other selector issues) open until we have tests checked in to the repository to prevent regressions. Also, unfortunately, per #3659, we may have to revert the dom-selector integration. Your report here makes me think doing so in a major version might be better...
Basic info:
It is not possible to use the :host pseudo class inside the selector parameter of
querySelector
orquerySelectorAll
injsdom
.Minimal reproduction case
How does similar code behave in browsers?
In browsers, both queries return the same element, the first one just queries for an
article
in any place inside the shadow DOM subtree, the second one specificaly queries for an article that is an inmmediate child of theshadowRoot
using the :host pseudo class.https://jsbin.com/nifuso/edit?html,js,console