mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
style: Formatting nits in color parsing.
This commit is contained in:
parent
ea5efd9e2f
commit
e91c9ec7fe
1 changed files with 6 additions and 5 deletions
|
@ -125,16 +125,17 @@ impl Color {
|
||||||
/// Parse a color, with quirks.
|
/// Parse a color, with quirks.
|
||||||
///
|
///
|
||||||
/// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
|
/// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
|
||||||
pub fn parse_quirky<'i, 't>(context: &ParserContext,
|
pub fn parse_quirky<'i, 't>(
|
||||||
input: &mut Parser<'i, 't>,
|
context: &ParserContext,
|
||||||
allow_quirks: AllowQuirks)
|
input: &mut Parser<'i, 't>,
|
||||||
-> Result<Self, ParseError<'i>> {
|
allow_quirks: AllowQuirks,
|
||||||
|
) -> Result<Self, ParseError<'i>> {
|
||||||
input.try(|i| Self::parse(context, i)).or_else(|e| {
|
input.try(|i| Self::parse(context, i)).or_else(|e| {
|
||||||
if !allow_quirks.allowed(context.quirks_mode) {
|
if !allow_quirks.allowed(context.quirks_mode) {
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
Color::parse_quirky_color(input)
|
Color::parse_quirky_color(input)
|
||||||
.map(|rgba| Color::rgba(rgba))
|
.map(Color::rgba)
|
||||||
.map_err(|_| e)
|
.map_err(|_| e)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue