Re: [csswg-drafts] [selectors-4] Consider disallowing logical combination pseudo-classes inside :has() (#6952)

```js
document.querySelector(":has(:has(body))"); 
// vs. 
document.querySelector(":has(:has(body), body)");
```

In Safari (15.5) the first query throws with `SyntaxError: The string did not match the expected pattern.`
In Chrome (104) it returns `null`

The second query returns `html` in both browsers.

I am unsure which behaviour is correct, but I suspect this is a bug in Webkit if I compare with the behaviour of `document.querySelector(":is(:invalid-thing)");` which returns `null`.


WPT also still lacks tests for error recovery in `:has()` : https://github.com/web-platform-tests/wpt/pull/32200/files

-- 
GitHub Notification of comment by romainmenke
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6952#issuecomment-1148856670 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 7 June 2022 15:53:34 UTC