mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Have shorthand parsing functions return values
Shorthands are responsible to set all its longhands to a proper value, rather than returning None. Fixes #15380.
This commit is contained in:
parent
2e07ce7e84
commit
f33b0b4ea3
18 changed files with 240 additions and 259 deletions
|
@ -115,14 +115,14 @@ fn webkit_text_stroke_shorthand_should_parse_properly() {
|
|||
|
||||
let mut parser = Parser::new("thin red");
|
||||
let result = _webkit_text_stroke::parse_value(&context, &mut parser).unwrap();
|
||||
assert_eq!(result._webkit_text_stroke_color.unwrap(), parse_longhand!(_webkit_text_stroke_color, "red"));
|
||||
assert_eq!(result._webkit_text_stroke_width.unwrap(), parse_longhand!(_webkit_text_stroke_width, "thin"));
|
||||
assert_eq!(result._webkit_text_stroke_color, parse_longhand!(_webkit_text_stroke_color, "red"));
|
||||
assert_eq!(result._webkit_text_stroke_width, parse_longhand!(_webkit_text_stroke_width, "thin"));
|
||||
|
||||
// ensure its no longer sensitive to order
|
||||
let mut parser = Parser::new("red thin");
|
||||
let result = _webkit_text_stroke::parse_value(&context, &mut parser).unwrap();
|
||||
assert_eq!(result._webkit_text_stroke_color.unwrap(), parse_longhand!(_webkit_text_stroke_color, "red"));
|
||||
assert_eq!(result._webkit_text_stroke_width.unwrap(), parse_longhand!(_webkit_text_stroke_width, "thin"));
|
||||
assert_eq!(result._webkit_text_stroke_color, parse_longhand!(_webkit_text_stroke_color, "red"));
|
||||
assert_eq!(result._webkit_text_stroke_width, parse_longhand!(_webkit_text_stroke_width, "thin"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue