Files
tubestation/servo/tests/unit/style/parsing/containment.rs
Nazım Can Altınova 607e3e1da5 servo: Merge #16467 - stylo: Add glue for contain property (from canaltinova:contain); r=emilio
In gecko, `size` and `content` values aren't implemented yet. So I had to disable these parts with mako. We will need to update the property and the glue once these are implemented in gecko.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1354998](https://bugzilla.mozilla.org/show_bug.cgi?id=1354998)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so tha
t we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 7ff803e322a4488eb6b7f813b5f4f82abc49c6c1
2017-04-22 16:58:24 -05:00

28 lines
1.0 KiB
Rust

/* 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 parsing::parse;
use style_traits::ToCss;
#[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 | contain::STRICT_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, "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);
}