mirror of
https://github.com/servo/servo.git
synced 2025-08-18 11:55:39 +01:00
Fix parsing of ClipRect
This commit is contained in:
parent
050d9d9097
commit
d7c227f614
6 changed files with 94 additions and 27 deletions
35
tests/unit/style/parsing/effects.rs
Normal file
35
tests/unit/style/parsing/effects.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* 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 servo_url::ServoUrl;
|
||||
use style::parser::ParserContext;
|
||||
use style::stylesheets::Origin;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[test]
|
||||
fn test_clip() {
|
||||
use style::properties::longhands::clip;
|
||||
|
||||
assert_roundtrip_with_context!(clip::parse, "auto");
|
||||
assert_roundtrip_with_context!(clip::parse, "rect(1px, 2px, 3px, 4px)");
|
||||
assert_roundtrip_with_context!(clip::parse, "rect(1px, auto, auto, 4px)");
|
||||
assert_roundtrip_with_context!(clip::parse, "rect(auto, auto, auto, auto)");
|
||||
|
||||
// Non-standard syntax
|
||||
assert_roundtrip_with_context!(clip::parse,
|
||||
"rect(1px 2px 3px 4px)",
|
||||
"rect(1px, 2px, 3px, 4px)");
|
||||
assert_roundtrip_with_context!(clip::parse,
|
||||
"rect(auto 2px 3px auto)",
|
||||
"rect(auto, 2px, 3px, auto)");
|
||||
assert_roundtrip_with_context!(clip::parse,
|
||||
"rect(1px auto auto 4px)",
|
||||
"rect(1px, auto, auto, 4px)");
|
||||
assert_roundtrip_with_context!(clip::parse,
|
||||
"rect(auto auto auto auto)",
|
||||
"rect(auto, auto, auto, auto)");
|
||||
}
|
||||
|
|
@ -82,6 +82,7 @@ mod background;
|
|||
mod basic_shape;
|
||||
mod border;
|
||||
mod column;
|
||||
mod effects;
|
||||
mod font;
|
||||
mod image;
|
||||
mod inherited_box;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue