/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use parsing::parse; use style::parser::Parse; use style::properties::longhands::{border_image_outset, border_image_repeat, border_image_slice}; use style::properties::longhands::{border_image_source, border_image_width}; use style::properties::shorthands::border_image; use style::properties::MaybeBoxed; use style::values::specified::BorderRadius; use style_traits::ToCss;
#[test] fn border_image_shorthand_should_parse_when_all_properties_specified() { let input = "linear-gradient(red, blue) 30 30% 45 fill / 20px 40px / 10px round stretch"; let result = parse(border_image::parse_value, input).unwrap();
#[test] fn border_image_shorthand_should_parse_without_outset() { let input = "linear-gradient(red, blue) 30 30% 45 fill / 20px 40px round"; let result = parse(border_image::parse_value, input).unwrap();
#[test] fn border_image_shorthand_should_parse_without_width_or_outset() { let input = "linear-gradient(red, blue) 30 30% 45 fill round"; let result = parse(border_image::parse_value, input).unwrap();
#[test] fn border_image_shorthand_should_parse_with_just_source() { let result = parse(border_image::parse_value, "linear-gradient(red, blue)").unwrap();
#[test] fn border_image_outset_should_error_on_negative_length() { let result = parse(border_image_outset::parse, "-1em");
assert!(result.is_err());
}
#[test] fn border_image_outset_should_error_on_negative_number() { let result = parse(border_image_outset::parse, "-15");
assert!(result.is_err());
}
#[test] fn border_image_outset_should_return_number_on_plain_zero() { let result = parse(border_image_outset::parse, "0");
assert_eq!(result.unwrap(), parse_longhand!(border_image_outset, "0"));
}
#[test] fn border_image_outset_should_return_length_on_length_zero() { let result = parse(border_image_outset::parse, "0em");
assert_eq!(result.unwrap(), parse_longhand!(border_image_outset, "0em"));
}
#[test] fn test_border_style() { use style::values::specified::BorderStyle;
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"none"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"hidden"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"solid"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"double"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"dotted"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"dashed"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"groove"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"ridge"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"inset"#);
assert_roundtrip_with_context!(<BorderStyle as Parse>::parse, r#"outset"#);
}
#[test] fn test_border_spacing() { use style::properties::longhands::border_spacing;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.