mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +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.
|
||||
///
|
||||
/// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
|
||||
pub fn parse_quirky<'i, 't>(context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
allow_quirks: AllowQuirks)
|
||||
-> Result<Self, ParseError<'i>> {
|
||||
pub fn parse_quirky<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
allow_quirks: AllowQuirks,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
input.try(|i| Self::parse(context, i)).or_else(|e| {
|
||||
if !allow_quirks.allowed(context.quirks_mode) {
|
||||
return Err(e);
|
||||
}
|
||||
Color::parse_quirky_color(input)
|
||||
.map(|rgba| Color::rgba(rgba))
|
||||
.map(Color::rgba)
|
||||
.map_err(|_| e)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue