support compound selectors and complex selectors within :not() negation pseudo-class
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
People
(Reporter: lucas, Assigned: emilio)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, parity-safari)
Attachments
(2 files)
Comment 1•12 years ago
|
||
Updated•11 years ago
|
Updated•9 years ago
|
Updated•8 years ago
|
![]() |
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Assignee | ||
Comment 7•7 years ago
|
||
Assignee | ||
Comment 9•7 years ago
|
||
Assignee | ||
Comment 13•5 years ago
|
||
This fixes the failures this bug is about and should just work with the
invalidation improvements I did for :is / :where.
It seems Chromium is adding tests for that1 so I'll wait for those
before landing and ensure they pass.
Updated•5 years ago
|
Assignee | ||
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fd29ba131d13
https://hg.mozilla.org/mozilla-central/rev/4ae6c523d160
Comment 20•5 years ago
|
||
Added to release notes, updated BCD and example on MDN property page.
Comment 21•5 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Very convenient new CSS feature
[Affects Firefox for Android]: yes
[Suggested wording]: :not CSS selector now supports selector lists and more complex selectors
[Links (documentation, blog post, etc)]: https://caniuse.com/css-not-sel-list
here's the MDN page: https://developer.mozilla.org/en-US/docs/Web/CSS/:not (compat data needs updating for FF 84)
tldr: :not(X):not(Y):not(Z)
or :not(:is(X,Y,Z))
can now be :not(X, Y, Z)
Assignee | ||
Comment 22•5 years ago
|
||
(In reply to Tim Nguyen :ntim from comment #21)
tldr:
:not(X):not(Y):not(Z)
or:not(:is(X,Y,Z))
can now be:not(X, Y, Z)
:not(x):not(y) is not equivalent to :not(x, y) afaict.
If you match x but not y, then one applies but other doesn't.
Comment 23•5 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #22)
(In reply to Tim Nguyen :ntim from comment #21)
tldr:
:not(X):not(Y):not(Z)
or:not(:is(X,Y,Z))
can now be:not(X, Y, Z)
:not(x):not(y) is not equivalent to :not(x, y) afaict.
If you match x but not y, then one applies but other doesn't.
I struggle to make sense of this. From what I remember we've been using :not(foo):not(bar)
and :not(:is(foo, bar))
interchangeably. https://caniuse.com/css-not-sel-list also states that:
:not(a):not(.b):not([c])
can instead be written as:not(a, .b, [c])
These are equivalent from what I can tell:
<style>
#a :not(:disabled):not(:hover),
#b :not(:is(:disabled, :hover)),
#c :not(:disabled, :hover) {
outline: 1px solid red;
}
</style>
<p id="a">
<input type="button" disabled>
<input type="button">
</p>
<p id="b">
<input type="button" disabled>
<input type="button">
</p>
<p id="c">
<input type="button" disabled>
<input type="button">
</p>
Assignee | ||
Comment 24•5 years ago
|
||
Err, yeah, I got that wrong, sorry.
They are in fact equivalent, because :not(a):not(b)
is effectively !a && !b
, and :not(a, b)
or :not(:is(a, b))
is just !(a || b)
, which is the same, that is, will only really match when both are false.
Comment 26•5 years ago
|
||
We generally don't add feature like this to the general release notes. MDN is the right place for it.
Description
•