[dom] Element.matches and pseudo-elements (#185)

https://dom.spec.whatwg.org/#dom-element-matches links to https://drafts.csswg.org/selectors-4/#match-a-selector-against-an-element which links to https://drafts.csswg.org/selectors-4/#evaluate-a-selector which says:

> APIs using this algorithm […] may optionally provide […] which pseudo-elements are allowed to show up in the match list, if any. If not specified, this defaults to allowing all pseudo-elements.

As far as I understand, "allowing all pseudo-elements" means that pseudo-elements are effectively ignored during matching. For example, `document.body.matches('body::after')` should return `true`. This seems backwards, and indeed Firefox 44 and Chromium 49 both return `false`.

The DOM spec should probably add “with an empty list of pseudo-elements” near “the result of *match a selector against an element*”.

Other Selectors-related APIs likely have similar issues.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/185

Received on Friday, 4 March 2016 21:51:45 UTC