mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
implement parsing of line_height and border_image_outset to parse plain zero as Number
This commit is contained in:
parent
b38da9b920
commit
beeca1213c
4 changed files with 69 additions and 18 deletions
|
@ -102,3 +102,29 @@ fn webkit_text_stroke_shorthand_should_parse_properly() {
|
|||
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"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn line_height_should_return_number_on_plain_zero() {
|
||||
use media_queries::CSSErrorReporterTest;
|
||||
use servo_url::ServoUrl;
|
||||
use style::properties::longhands::line_height;
|
||||
|
||||
let url = ServoUrl::parse("http://localhost").unwrap();
|
||||
let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest));
|
||||
let mut parser = Parser::new("0");
|
||||
let result = line_height::parse(&context, &mut parser);
|
||||
assert_eq!(result.unwrap(), parse_longhand!(line_height, "0"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn line_height_should_return_length_on_length_zero() {
|
||||
use media_queries::CSSErrorReporterTest;
|
||||
use servo_url::ServoUrl;
|
||||
use style::properties::longhands::line_height;
|
||||
|
||||
let url = ServoUrl::parse("http://localhost").unwrap();
|
||||
let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest));
|
||||
let mut parser = Parser::new("0px");
|
||||
let result = line_height::parse(&context, &mut parser);
|
||||
assert_eq!(result.unwrap(), parse_longhand!(line_height, "0px"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue