This addresses a minor regression in bloom-matching.html. The common
case here is that there's no selector to the right of the
pseudo-element, so keep that path inline, while keeping all other checks
out of line.
Differential Revision: https://phabricator.services.mozilla.com/D76793
After bug 1632647, we can have pseudo-classes inside :not / :is /
:where, which the invalidation and matching code weren't handling.
Add a few tests for this stuff working as expected.
Differential Revision: https://phabricator.services.mozilla.com/D76160
This implements the easy / straight-forward parts of the :where / :is
selectors.
The biggest missing piece is to handle properly invalidation when there
are combinators present inside the :where. That's the hard part of this,
actually.
But this is probably worth landing in the interim. This fixes some of
the visitors that were easy to fix.
Differential Revision: https://phabricator.services.mozilla.com/D70788
Per the spec it shouldn't match, and the front-end has been bitten by this
multiple times.
Differential Revision: https://phabricator.services.mozilla.com/D68213
--HG--
extra : moz-landing-system : lando
We need to ensure the rules that override all properties for scrollbar
part elements only apply to those that are NAC (and so will be eligible
for NAC style sharing). We have some uses of non-NAC <scrollbar>
elements that should continue to inherit properties from their parents.
To avoid any changes in rule matching order that come with changing specificity,
we add a new :-moz-native-anonymous-no-specificity pseudo-class.
While we're here, we note :-moz-native-anonymous-no-specificity (and the
regular :-moz-native-anonymous pseudo-class) as not needing style
sharing cache revalidation, as we never share NAC styles.
Differential Revision: https://phabricator.services.mozilla.com/D56154
--HG--
extra : moz-landing-system : lando
Unlike for :host() or ::slotted(), or regular rules, we don't need a whole
SelectorMap<>, so gotta make the code a bit more generic.
Depends on D32645
Differential Revision: https://phabricator.services.mozilla.com/D32646
--HG--
extra : moz-landing-system : lando
This grows the selector struct, but only in 32-bit, since in 64-bit we take
space from the alignment padding that we're paying due to having the size of the
slice as a word.
Depends on D32644
Differential Revision: https://phabricator.services.mozilla.com/D32645
--HG--
extra : moz-landing-system : lando
D29542 fixed the bogus checks that was making nested pseudo-elements match
author rules. This adds tests and ends up being just a cleanup, though as it
turns out we it also fixes an issue with ::slotted() matched from
Element.matches.
Differential Revision: https://phabricator.services.mozilla.com/D27529
--HG--
extra : moz-landing-system : lando
Disabled for now of course. This should be pretty uncontroversial I'd think.
Differential Revision: https://phabricator.services.mozilla.com/D28060
--HG--
extra : moz-landing-system : lando
We always include the combinator for pseudo-elements now (not including it was
just an optimization) in order to not match when nested pseudo-elements are
involved.
We could add a more generic check in `matches_simple_selector` like:
```
if element.is_pseudo_element() {
match *selector {
Component::PseudoElement(..) |
Component::NonTSPseudoClass(..) => {},
_ => return false,
}
}
```
But even that wouldn't be enough to make selectors like `:hover::marker` not
match on the `::before::marker` pseudo-element, plus that code is really hot.
So for now do the check on the `next_element_for_combinator` function. It's a
bit hacky but it's the best I could came up with...
While at it, simplify some checks to use is_pseudo_element() instead of
implemented_pseudo_element() directly.
Only the Rust patch as-is would make markers for ::before and ::after on list
items not show up, so we also need to switch ::marker to use ProbeMarkerStyle()
rather than ProbePseudoElementStyle(), since the marker should exist even if it
matches no rules.
Differential Revision: https://phabricator.services.mozilla.com/D27529
--HG--
extra : moz-landing-system : lando
I'm going to unconditionally generate the PseudoElement combinator, and this
causes issues since we'll put the raw `::pseudo` selectors in the host bucket,
which is obviously wrong.
Differential Revision: https://phabricator.services.mozilla.com/D27528
--HG--
extra : moz-landing-system : lando
::slotted() is already weird in the sense that it supports a pseudo-element
afterwards (so ::slotted(*)::before is valid for example).
::part() is weirder because you are supposed to allow stuff like
::part(foo):hover, ::part(foo):hover::before, etc.
In order to avoid making the already-complex parse_compound_selector more
complex, shuffle stuff so that we pass the progress of our current compound
selector around, and is the parsing code for each selector which decides whether
it's ok to parse at the given point.
Differential Revision: https://phabricator.services.mozilla.com/D27158
--HG--
extra : moz-landing-system : lando
We could keep using ParsedCaseSensitivity::CaseSensitive as a temporary stand-in
for "case-sensitive or maybe not depending on what HTML says" until we check the
attribute list, but it seems better to make that explicit.
Differential Revision: https://phabricator.services.mozilla.com/D14093
--HG--
extra : moz-landing-system : lando
This implements the selector(<complex-selector>) syntax for @supports.
See https://github.com/w3c/csswg-drafts/issues/3207 for explainer and
discussion.
Probably would should wait for that to be sorted out to land this, or maybe we
should put it behind a pref to get the code landed and change our
implementation if the discussion there leads to a change.
Differential Revision: https://phabricator.services.mozilla.com/D8864
--HG--
extra : moz-landing-system : lando
This saves about 37 KiB of memory across the UA style sheets.
MozReview-Commit-ID: EoZnlmyWwxX
--HG--
extra : rebase_source : cd8ef0ba838618f9a4583b7d9896caa3a0602199
This saves about 37 KiB of memory across the UA style sheets.
MozReview-Commit-ID: EoZnlmyWwxX
--HG--
extra : rebase_source : 471fc63e521a4332bb92b4a73cd31a4bbe0b2dfe