Bug 209707 - [CSS Selectors 4] Add support for `:is()` with the same logic for the existing `:matches()`
Summary: [CSS Selectors 4] Add support for `:is()` with the same logic for the existin...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-28 13:50 PDT by Devin Rousso
Modified: 2020-03-30 17:54 PDT (History)
14 users (show)

See Also:


Attachments
Patch (2.92 MB, patch)
2020-03-28 14:08 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (2.92 MB, patch)
2020-03-30 10:22 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (2.90 MB, patch)
2020-03-30 12:50 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (2.90 MB, patch)
2020-03-30 13:42 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2020-03-28 13:50:43 PDT
[selectors-4] Rename :matches() to :is() <https://github.com/w3c/csswg-drafts/issues/3258>
Comment 1 Devin Rousso 2020-03-28 14:08:34 PDT
Created attachment 394841 [details]
Patch
Comment 2 Antti Koivisto 2020-03-29 05:52:23 PDT
Comment on attachment 394841 [details]
Patch

Nice!
Comment 3 Antti Koivisto 2020-03-29 05:56:29 PDT
Comment on attachment 394841 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394841&action=review

> Source/WebCore/css/CSSSelector.h:125
> +            PseudoClassIs,
>              PseudoClassMatches,

Might want to add a comment on PseudoClassMatches here, mentioning it is an obsolete synonym for PseudoClassIs.
Comment 4 Devin Rousso 2020-03-30 10:22:40 PDT
Created attachment 394931 [details]
Patch
Comment 5 Simon Fraser (smfr) 2020-03-30 11:21:12 PDT
Comment on attachment 394931 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394931&action=review

> Source/WebCore/ChangeLog:38
> +               imported/w3c/web-platform-tests/css/selectors/invalidation/is.html
> +               imported/w3c/web-platform-tests/css/selectors/is-nested.html
> +               imported/w3c/web-platform-tests/css/selectors/is-specificity.html

You should not change these tests directly. Changes need to get upstream to WPT from http/wpt/
Comment 6 Antti Koivisto 2020-03-30 11:27:10 PDT
Meanwhile you can just land modified versions outside imported/w3c/web-platform-tests and skips the WPT versions.
Comment 7 Antti Koivisto 2020-03-30 11:27:52 PDT
...or land them as failures.
Comment 8 Devin Rousso 2020-03-30 11:37:49 PDT
Comment on attachment 394931 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394931&action=review

>> Source/WebCore/ChangeLog:38
>> +               imported/w3c/web-platform-tests/css/selectors/is-specificity.html
> 
> You should not change these tests directly. Changes need to get upstream to WPT from http/wpt/

They've already been changed in upstream <https://github.com/web-platform-tests/wpt/pull/14071>.
Comment 9 Simon Fraser (smfr) 2020-03-30 11:42:00 PDT
(In reply to Devin Rousso from comment #8)
> Comment on attachment 394931 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=394931&action=review
> 
> >> Source/WebCore/ChangeLog:38
> >> +               imported/w3c/web-platform-tests/css/selectors/is-specificity.html
> > 
> > You should not change these tests directly. Changes need to get upstream to WPT from http/wpt/
> 
> They've already been changed in upstream
> <https://github.com/web-platform-tests/wpt/pull/14071>.

Then wait for that to land, re-import (marking failing), then land this patch?
Comment 10 Devin Rousso 2020-03-30 12:00:57 PDT
(In reply to Simon Fraser (smfr) from comment #9)
> (In reply to Devin Rousso from comment #8)
> > Comment on attachment 394931 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=394931&action=review
> > 
> > >> Source/WebCore/ChangeLog:38
> > >> +               imported/w3c/web-platform-tests/css/selectors/is-specificity.html
> > > 
> > > You should not change these tests directly. Changes need to get upstream to WPT from http/wpt/
> > 
> > They've already been changed in upstream <https://github.com/web-platform-tests/wpt/pull/14071>.
> 
> Then wait for that to land, re-import (marking failing), then land this patch?

They've already landed too 😅 <https://github.com/web-platform-tests/wpt/commit/4decb8a>
Comment 11 Devin Rousso 2020-03-30 12:50:24 PDT
Created attachment 394949 [details]
Patch

Looks like Antti already imported the WPT for `:is()` in r259194 :)
Comment 12 Devin Rousso 2020-03-30 13:42:35 PDT
Created attachment 394954 [details]
Patch
Comment 13 EWS 2020-03-30 17:53:03 PDT
Committed r259261: <https://trac.webkit.org/changeset/259261>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 394954 [details].
Comment 14 Radar WebKit Bug Importer 2020-03-30 17:54:18 PDT
<rdar://problem/61082755>