WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
210419
[CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes
https://bugs.webkit.org/show_bug.cgi?id=210419
Summary
[CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes
Antti Koivisto
Reported
2020-04-13 02:46:52 PDT
CSS selector specification drafts at some point had a concept of "dynamic specificity" where the specificity of a selector depended on the element it matched. It was only ever used with :matches and :nth-child pseudo classes and has subsequently been removed. Selector specificity can now always be computed statically. There is a ton of code to support this obsolete feature. It can be removed.
Attachments
patch
(111.82 KB, patch)
2020-04-13 03:21 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(111.96 KB, patch)
2020-04-13 03:42 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(112.68 KB, patch)
2020-04-13 04:34 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(113.27 KB, patch)
2020-04-13 06:26 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(113.32 KB, patch)
2020-04-13 06:32 PDT
,
Antti Koivisto
simon.fraser
: review+
Details
Formatted Diff
Diff
patch
(113.22 KB, patch)
2020-04-13 09:58 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(102.48 KB, patch)
2020-04-14 03:20 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2020-04-13 03:21:02 PDT
Created
attachment 396264
[details]
patch
Antti Koivisto
Comment 2
2020-04-13 03:42:30 PDT
Created
attachment 396265
[details]
patch
Antti Koivisto
Comment 3
2020-04-13 04:34:56 PDT
Created
attachment 396266
[details]
patch
Antti Koivisto
Comment 4
2020-04-13 06:26:50 PDT
Created
attachment 396267
[details]
patch
Antti Koivisto
Comment 5
2020-04-13 06:32:03 PDT
Created
attachment 396268
[details]
patch
Simon Fraser (smfr)
Comment 6
2020-04-13 09:40:07 PDT
Comment on
attachment 396268
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=396268&action=review
> LayoutTests/fast/css/is-specificity-3-expected.html:6 > +<div style="color: purple; background-color: blue;">Text</nottarget>
Mixing div and nottarget tags?
> LayoutTests/fast/css/matches-specificity-3-expected.html:6 > +<div style="color: purple; background-color: blue;">Text</nottarget>
Ditto.
> Source/WebCore/css/CSSSelector.cpp:95 > +static unsigned selectorSpecificity(const CSSSelector& firstSimpleSelector)
Would be nice to have a typedef for "specificity" rather than using 'unsigned' everywhere.
Antti Koivisto
Comment 7
2020-04-13 09:58:59 PDT
Created
attachment 396298
[details]
patch
Antti Koivisto
Comment 8
2020-04-13 10:01:08 PDT
> Would be nice to have a typedef for "specificity" rather than using > 'unsigned' everywhere.
Or even wrap it into a class.
EWS
Comment 9
2020-04-13 10:46:00 PDT
Committed
r260024
: <
https://trac.webkit.org/changeset/260024
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 396298
[details]
.
Radar WebKit Bug Importer
Comment 10
2020-04-13 10:46:24 PDT
<
rdar://problem/61724793
>
WebKit Commit Bot
Comment 11
2020-04-14 00:05:25 PDT
Re-opened since this is blocked by
bug 210480
Antti Koivisto
Comment 12
2020-04-14 03:20:13 PDT
Created
attachment 396398
[details]
patch Reduces scope a bit so compiled selectors still cache the specificity.
EWS
Comment 13
2020-04-14 04:37:45 PDT
Committed
r260069
: <
https://trac.webkit.org/changeset/260069
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 396398
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug