Fix a no-longer valid assumption in pseudo-element matching / invalidation code.

After bug 1632647, we can have pseudo-classes inside :not / :is /
:where, which the invalidation and matching code weren't handling.

Add a few tests for this stuff working as expected.

Differential Revision: https://phabricator.services.mozilla.com/D76160

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1639533
gecko-commit: 23ddff9da376923836d2e66e9aa71191a065ca7c
gecko-integration-branch: autoland
gecko-reviewers: heycam
diff --git a/css/css-scoping/slotted-parsing.html b/css/css-scoping/slotted-parsing.html
index 89de0e5..f0062c8 100644
--- a/css/css-scoping/slotted-parsing.html
+++ b/css/css-scoping/slotted-parsing.html
@@ -17,6 +17,10 @@
   test_invalid_selector("::slotted(*):host");
   test_invalid_selector("::slotted(*):host(div)");
   test_invalid_selector("::slotted(*):hover");
+  test_invalid_selector("::slotted(*):is(:hover)");
+  test_invalid_selector("::slotted(*):where(:hover)");
+  test_invalid_selector("::slotted(*):is(#id)");
+  test_invalid_selector("::slotted(*):where(#id)");
   test_invalid_selector("::slotted(*):read-only");
   test_invalid_selector("::slotted(*)::slotted(*)");
   test_invalid_selector("::slotted(*)::before::slotted(*)");