mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Implement parsing and serialization for nth-child(An+B of selector list) and :nth-last-child(An+B of selector list)
:nth-{,last-}child parsing is disabled by default for now by pref layout.css.nth-child-of.enabled. Differential Revision: https://phabricator.services.mozilla.com/D165895
This commit is contained in:
parent
b7d64ee6a4
commit
1c8408e97e
6 changed files with 123 additions and 11 deletions
|
@ -318,6 +318,11 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
|||
true
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn parse_nth_child_of(&self) -> bool {
|
||||
static_prefs::pref!("layout.css.nth-child-of.enabled")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn parse_is_and_where(&self) -> bool {
|
||||
true
|
||||
|
|
|
@ -1918,7 +1918,8 @@ fn component_needs_revalidation(
|
|||
Component::AttributeInNoNamespace { .. } |
|
||||
Component::AttributeOther(_) |
|
||||
Component::Empty |
|
||||
Component::Nth(..) => true,
|
||||
Component::Nth(_) |
|
||||
Component::NthOf(_) => true,
|
||||
Component::NonTSPseudoClass(ref p) => p.needs_cache_revalidation(),
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue