mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
style: Make weird color parsing marginally faster.
This commit is contained in:
parent
2192090ea5
commit
0717047e1e
2 changed files with 8 additions and 8 deletions
|
@ -160,12 +160,14 @@ impl Parse for Color {
|
|||
Err(e) => {
|
||||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
if let Ok(system) = input.try(SystemColor::parse) {
|
||||
return Ok(Color::System(system));
|
||||
}
|
||||
if let Ok(ident) = input.expect_ident() {
|
||||
if let Ok(system) = SystemColor::from_ident(ident) {
|
||||
return Ok(Color::System(system));
|
||||
}
|
||||
|
||||
if let Ok(c) = gecko::SpecialColorKeyword::parse(input) {
|
||||
return Ok(Color::Special(c));
|
||||
if let Ok(c) = gecko::SpecialColorKeyword::from_ident(ident) {
|
||||
return Ok(Color::Special(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue