mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Parsing / serialization for CSS contain
This commit is contained in:
parent
9d0b481789
commit
535959f2a5
3 changed files with 130 additions and 0 deletions
26
tests/unit/style/parsing/containment.rs
Normal file
26
tests/unit/style/parsing/containment.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::Parser;
|
||||
use media_queries::CSSErrorReporterTest;
|
||||
use style::parser::ParserContext;
|
||||
use style::stylesheets::Origin;
|
||||
|
||||
#[test]
|
||||
fn contain_longhand_should_parse_correctly() {
|
||||
use style::properties::longhands::contain;
|
||||
use style::properties::longhands::contain::SpecifiedValue;
|
||||
|
||||
let none = parse_longhand!(contain, "none");
|
||||
assert_eq!(none, SpecifiedValue::empty());
|
||||
|
||||
let strict = parse_longhand!(contain, "strict");
|
||||
assert_eq!(strict, contain::STRICT);
|
||||
|
||||
let style_paint = parse_longhand!(contain, "style paint");
|
||||
assert_eq!(style_paint, contain::STYLE | contain::PAINT);
|
||||
|
||||
// Assert that the `2px` is not consumed, which would trigger parsing failure in real use
|
||||
assert_parser_exhausted!(contain, "layout 2px", false);
|
||||
}
|
|
@ -87,6 +87,7 @@ mod basic_shape;
|
|||
mod border;
|
||||
mod box_;
|
||||
mod column;
|
||||
mod containment;
|
||||
mod effects;
|
||||
mod font;
|
||||
mod image;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue