mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implement the unitless length quirk for clip
This commit is contained in:
parent
46913ffe1d
commit
ba59fafb44
3 changed files with 13 additions and 21 deletions
|
@ -618,7 +618,17 @@ impl Length {
|
|||
|
||||
impl Parse for Length {
|
||||
fn parse(context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||
Self::parse_internal(context, input, AllowedLengthType::All, AllowQuirks::No)
|
||||
Self::parse_quirky(context, input, AllowQuirks::No)
|
||||
}
|
||||
}
|
||||
|
||||
impl Length {
|
||||
/// Parses a length, with quirks.
|
||||
pub fn parse_quirky(context: &ParserContext,
|
||||
input: &mut Parser,
|
||||
allow_quirks: AllowQuirks)
|
||||
-> Result<Self, ()> {
|
||||
Self::parse_internal(context, input, AllowedLengthType::All, allow_quirks)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1291,13 +1291,13 @@ impl ToComputedValue for ClipRect {
|
|||
|
||||
impl Parse for ClipRect {
|
||||
fn parse(context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||
use values::specified::Length;
|
||||
use values::specified::{AllowQuirks, Length};
|
||||
|
||||
fn parse_argument(context: &ParserContext, input: &mut Parser) -> Result<Option<Length>, ()> {
|
||||
if input.try(|input| input.expect_ident_matching("auto")).is_ok() {
|
||||
Ok(None)
|
||||
} else {
|
||||
Length::parse(context, input).map(Some)
|
||||
Length::parse_quirky(context, input, AllowQuirks::Yes).map(Some)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue