Bug 145357

Summary: :matches incorrectly matches pseudo elements
Product: WebKit Reporter: Elliott Sprehn <esprehn>
Component: CSSAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: benjamin, koivisto, ysuzuki
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Elliott Sprehn 2015-05-24 02:28:14 PDT
http://dev.w3.org/csswg/selectors-4/#matches

The spec says:
"Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within :matches()."

<style>
div:matches(::before, ::after) {
    content: "Should not match.";
}
</style>

<div></div>
Comment 1 Yusuke Suzuki 2015-05-24 05:28:47 PDT
Hi Benjamin, do you have any thought about this?

Is this a solid decision in css-wg, or still controversial?
If it's a solid decision, we should drop this feature.
But if it's still discussed and not mature yet, we should keep it until we meet the consensus.
Comment 2 Benjamin Poulain 2015-05-26 14:01:56 PDT
Last time we talked about this, the CSSWG was still bikesheding on the definition of pseudo elements.

Given how insanely bad the CSSWG is, and the value of this feature, I am ok with keeping this "bug" around.
Comment 3 Elliott Sprehn 2015-05-26 14:04:13 PDT
(In reply to comment #2)
> Last time we talked about this, the CSSWG was still bikesheding on the
> definition of pseudo elements.
> 
> Given how insanely bad the CSSWG is, and the value of this feature, I am ok
> with keeping this "bug" around.

That just means content will depend on it and then other browsers will need to copy your unspec'ed behavior.
Comment 4 Benjamin Poulain 2015-05-26 14:22:42 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > Last time we talked about this, the CSSWG was still bikesheding on the
> > definition of pseudo elements.
> > 
> > Given how insanely bad the CSSWG is, and the value of this feature, I am ok
> > with keeping this "bug" around.
> 
> That just means content will depend on it and then other browsers will need
> to copy your unspec'ed behavior.

We made a proposal for a formal definition several months ago.
Comment 5 Antti Koivisto 2020-01-24 00:02:16 PST

*** This bug has been marked as a duplicate of bug 206654 ***