mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
selectors: Cherry-pick some fixes that got lost.
This commit is contained in:
parent
31e8e418ea
commit
aa4d2b0b0d
3 changed files with 4 additions and 25 deletions
|
@ -421,22 +421,6 @@ where
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse a comma separated list of compound selectors.
|
|
||||||
pub fn parse_compound_selector_list<'i, 't, P, Impl>(
|
|
||||||
parser: &P,
|
|
||||||
input: &mut CssParser<'i, 't>,
|
|
||||||
) -> Result<Box<[Selector<Impl>]>, ParseError<'i, P::Error>>
|
|
||||||
where
|
|
||||||
P: Parser<'i, Impl = Impl>,
|
|
||||||
Impl: SelectorImpl,
|
|
||||||
{
|
|
||||||
input
|
|
||||||
.parse_comma_separated(|input| {
|
|
||||||
parse_inner_compound_selector(parser, input, SelectorParsingState::empty())
|
|
||||||
})
|
|
||||||
.map(|selectors| selectors.into_boxed_slice())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Ancestor hashes for the bloom filter. We precompute these and store them
|
/// Ancestor hashes for the bloom filter. We precompute these and store them
|
||||||
/// inline with selectors to optimize cache performance during matching.
|
/// inline with selectors to optimize cache performance during matching.
|
||||||
/// This matters a lot.
|
/// This matters a lot.
|
||||||
|
@ -1522,14 +1506,6 @@ impl<Impl: SelectorImpl> ToCss for Component<Impl> {
|
||||||
AttributeOther(ref attr_selector) => attr_selector.to_css(dest),
|
AttributeOther(ref attr_selector) => attr_selector.to_css(dest),
|
||||||
|
|
||||||
// Pseudo-classes
|
// Pseudo-classes
|
||||||
Negation(ref arg) => {
|
|
||||||
dest.write_str(":not(")?;
|
|
||||||
for component in arg.iter() {
|
|
||||||
component.to_css(dest)?;
|
|
||||||
}
|
|
||||||
dest.write_str(")")
|
|
||||||
},
|
|
||||||
|
|
||||||
FirstChild => dest.write_str(":first-child"),
|
FirstChild => dest.write_str(":first-child"),
|
||||||
LastChild => dest.write_str(":last-child"),
|
LastChild => dest.write_str(":last-child"),
|
||||||
OnlyChild => dest.write_str(":only-child"),
|
OnlyChild => dest.write_str(":only-child"),
|
||||||
|
@ -1559,10 +1535,11 @@ impl<Impl: SelectorImpl> ToCss for Component<Impl> {
|
||||||
write_affine(dest, a, b)?;
|
write_affine(dest, a, b)?;
|
||||||
dest.write_char(')')
|
dest.write_char(')')
|
||||||
},
|
},
|
||||||
Is(ref list) | Where(ref list) => {
|
Is(ref list) | Where(ref list) | Negation(ref list) => {
|
||||||
match *self {
|
match *self {
|
||||||
Where(..) => dest.write_str(":where(")?,
|
Where(..) => dest.write_str(":where(")?,
|
||||||
Is(..) => dest.write_str(":is(")?,
|
Is(..) => dest.write_str(":is(")?,
|
||||||
|
Negation(..) => dest.write_str(":not(")?,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
serialize_selector_list(list.iter(), dest)?;
|
serialize_selector_list(list.iter(), dest)?;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[position-absolute-013.html]
|
[position-absolute-013.html]
|
||||||
|
expected: TIMEOUT
|
||||||
[.flexbox 309]
|
[.flexbox 309]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[position-absolute-013.html]
|
[position-absolute-013.html]
|
||||||
|
expected: TIMEOUT
|
||||||
[.flexbox 309]
|
[.flexbox 309]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue