mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Cherry-pick some parts of the cssparser update.
This commit is contained in:
parent
f7c5df5703
commit
7513bc293e
3 changed files with 8 additions and 8 deletions
|
@ -193,18 +193,18 @@ impl PseudoElement {
|
||||||
% for pseudo in SIMPLE_PSEUDOS:
|
% for pseudo in SIMPLE_PSEUDOS:
|
||||||
"${pseudo.value[1:]}" => {
|
"${pseudo.value[1:]}" => {
|
||||||
return Some(${pseudo_element_variant(pseudo)})
|
return Some(${pseudo_element_variant(pseudo)})
|
||||||
}
|
},
|
||||||
% endfor
|
% endfor
|
||||||
// Alias some legacy prefixed pseudos to their standardized name at parse time:
|
// Alias some legacy prefixed pseudos to their standardized name at parse time:
|
||||||
"-moz-selection" => {
|
"-moz-selection" => {
|
||||||
return Some(PseudoElement::Selection);
|
return Some(PseudoElement::Selection);
|
||||||
}
|
},
|
||||||
"-moz-placeholder" => {
|
"-moz-placeholder" => {
|
||||||
return Some(PseudoElement::Placeholder);
|
return Some(PseudoElement::Placeholder);
|
||||||
}
|
},
|
||||||
"-moz-list-bullet" | "-moz-list-number" => {
|
"-moz-list-bullet" | "-moz-list-number" => {
|
||||||
return Some(PseudoElement::Marker);
|
return Some(PseudoElement::Marker);
|
||||||
}
|
},
|
||||||
_ => {
|
_ => {
|
||||||
if starts_with_ignore_ascii_case(name, "-moz-tree-") {
|
if starts_with_ignore_ascii_case(name, "-moz-tree-") {
|
||||||
return PseudoElement::tree_pseudo_element(name, Box::new([]))
|
return PseudoElement::tree_pseudo_element(name, Box::new([]))
|
||||||
|
|
|
@ -396,7 +396,7 @@ impl<'a, 'i> ::selectors::Parser<'i> for SelectorParser<'a> {
|
||||||
parser,
|
parser,
|
||||||
)?.into()
|
)?.into()
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
_ => return Err(parser.new_custom_error(
|
_ => return Err(parser.new_custom_error(
|
||||||
SelectorParseErrorKind::UnsupportedPseudoClassOrElement(name.clone())
|
SelectorParseErrorKind::UnsupportedPseudoClassOrElement(name.clone())
|
||||||
))
|
))
|
||||||
|
|
|
@ -691,11 +691,11 @@ fn parse_baseline<'i, 't>(input: &mut Parser<'i, 't>) -> Result<AlignFlags, Pars
|
||||||
"first" => {
|
"first" => {
|
||||||
input.expect_ident_matching("baseline")?;
|
input.expect_ident_matching("baseline")?;
|
||||||
Ok(AlignFlags::BASELINE)
|
Ok(AlignFlags::BASELINE)
|
||||||
}
|
},
|
||||||
"last" => {
|
"last" => {
|
||||||
input.expect_ident_matching("baseline")?;
|
input.expect_ident_matching("baseline")?;
|
||||||
Ok(AlignFlags::LAST_BASELINE)
|
Ok(AlignFlags::LAST_BASELINE)
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -794,7 +794,7 @@ fn parse_legacy<'i, 't>(input: &mut Parser<'i, 't>) -> Result<AlignFlags, ParseE
|
||||||
.unwrap_or(AlignFlags::empty());
|
.unwrap_or(AlignFlags::empty());
|
||||||
|
|
||||||
return Ok(AlignFlags::LEGACY | flags)
|
return Ok(AlignFlags::LEGACY | flags)
|
||||||
}
|
},
|
||||||
"left" => AlignFlags::LEFT,
|
"left" => AlignFlags::LEFT,
|
||||||
"right" => AlignFlags::RIGHT,
|
"right" => AlignFlags::RIGHT,
|
||||||
"center" => AlignFlags::CENTER,
|
"center" => AlignFlags::CENTER,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue