mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Fix parsing of "center left" in parse_origin (fixes #15750)
This commit is contained in:
parent
bb66bf81d5
commit
ff2cf2c62f
2 changed files with 24 additions and 2 deletions
|
@ -51,10 +51,25 @@ fn test_longhands_parse_origin() {
|
|||
assert!(parsed.is_ok());
|
||||
assert_eq!(parser.is_exhausted(), true);
|
||||
|
||||
let mut parser = Parser::new("1px");
|
||||
let mut parser = Parser::new("center left");
|
||||
let parsed = longhands::parse_origin(&context, &mut parser);
|
||||
assert!(parsed.is_ok());
|
||||
assert_eq!(parser.is_exhausted(), true);
|
||||
|
||||
let mut parser = Parser::new("center right");
|
||||
let parsed = longhands::parse_origin(&context, &mut parser);
|
||||
assert!(parsed.is_ok());
|
||||
assert_eq!(parser.is_exhausted(), true);
|
||||
|
||||
let mut parser = Parser::new("center right 1px");
|
||||
let parsed = longhands::parse_origin(&context, &mut parser);
|
||||
assert!(parsed.is_ok());
|
||||
assert_eq!(parser.is_exhausted(), true);
|
||||
|
||||
let mut parser = Parser::new("1% right");
|
||||
let parsed = longhands::parse_origin(&context, &mut parser);
|
||||
assert!(parsed.is_ok());
|
||||
assert_eq!(parser.is_exhausted(), false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue