mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
text-overflow accepts only valid values for the second part of value
Fixes: https://github.com/servo/servo/issues/15491
This commit is contained in:
parent
2f8cf6afc3
commit
c7ed931276
2 changed files with 11 additions and 1 deletions
|
@ -51,7 +51,7 @@
|
||||||
}
|
}
|
||||||
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||||
let first = try!(Side::parse(context, input));
|
let first = try!(Side::parse(context, input));
|
||||||
let second = Side::parse(context, input).ok();
|
let second = input.try(|input| Side::parse(context, input)).ok();
|
||||||
Ok(SpecifiedValue {
|
Ok(SpecifiedValue {
|
||||||
first: first,
|
first: first,
|
||||||
second: second,
|
second: second,
|
||||||
|
|
|
@ -22,3 +22,13 @@ fn test_text_overflow() {
|
||||||
assert_roundtrip_with_context!(text_overflow::parse, r#""x" "y""#);
|
assert_roundtrip_with_context!(text_overflow::parse, r#""x" "y""#);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_text_overflow_parser_exhaustion() {
|
||||||
|
use style::properties::longhands::text_overflow;
|
||||||
|
|
||||||
|
assert_parser_exhausted!(text_overflow, r#"clip rubbish"#, false);
|
||||||
|
assert_parser_exhausted!(text_overflow, r#"clip"#, true);
|
||||||
|
assert_parser_exhausted!(text_overflow, r#"ellipsis"#, true);
|
||||||
|
assert_parser_exhausted!(text_overflow, r#"clip ellipsis"#, true);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue