mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Fix parsing/serialization bug in contain property
This commit is contained in:
parent
86aa4e89c5
commit
05a4febc40
2 changed files with 17 additions and 5 deletions
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use parsing::parse;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[test]
|
||||
fn contain_longhand_should_parse_correctly() {
|
||||
|
@ -13,11 +14,20 @@ fn contain_longhand_should_parse_correctly() {
|
|||
assert_eq!(none, SpecifiedValue::empty());
|
||||
|
||||
let strict = parse_longhand!(contain, "strict");
|
||||
assert_eq!(strict, contain::STRICT);
|
||||
assert_eq!(strict, contain::STRICT | contain::STRICT_BITS);
|
||||
|
||||
let strict = parse_longhand!(contain, "content");
|
||||
assert_eq!(strict, contain::CONTENT | contain::CONTENT_BITS);
|
||||
|
||||
let style_paint = parse_longhand!(contain, "style paint");
|
||||
assert_eq!(style_paint, contain::STYLE | contain::PAINT);
|
||||
|
||||
assert_roundtrip_with_context!(contain::parse, "strict");
|
||||
assert_roundtrip_with_context!(contain::parse, "size layout style paint");
|
||||
|
||||
assert_roundtrip_with_context!(contain::parse, "content");
|
||||
assert_roundtrip_with_context!(contain::parse, "layout style paint");
|
||||
|
||||
// Assert that the `2px` is not consumed, which would trigger parsing failure in real use
|
||||
assert_parser_exhausted!(contain::parse, "layout 2px", false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue