Make use of generics for transform-origin

This allows us to preserve keywords during serialisation.
This commit is contained in:
Anthony Ramine 2017-05-30 15:38:26 +02:00
parent b42aaf28df
commit 5d70580813
12 changed files with 241 additions and 221 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use parsing::parse;
use style::properties::longhands::{self, perspective_origin, transform_origin};
use style::properties::longhands::{perspective_origin, transform_origin};
use style_traits::ToCss;
#[test]
@ -30,16 +30,6 @@ fn test_clip() {
"rect(auto, auto, auto, auto)");
}
#[test]
fn test_longhands_parse_origin() {
assert_parser_exhausted!(longhands::parse_origin, "1px some-rubbish", false);
assert_parser_exhausted!(longhands::parse_origin, "1px 2px", true);
assert_parser_exhausted!(longhands::parse_origin, "center left", true);
assert_parser_exhausted!(longhands::parse_origin, "center right", true);
assert_parser_exhausted!(longhands::parse_origin, "center right 1px", true);
assert_parser_exhausted!(longhands::parse_origin, "1% right", false);
}
#[test]
fn test_effects_parser_exhaustion() {
assert_parser_exhausted!(perspective_origin::parse, "1px 1px", true);