mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
6300e820b4
commit
3d320fa96a
603 changed files with 1739 additions and 1648 deletions
|
@ -110,8 +110,7 @@ fn background_shorthand_should_parse_when_some_fields_set() {
|
|||
|
||||
#[test]
|
||||
fn background_shorthand_should_parse_comma_separated_declarations() {
|
||||
let input =
|
||||
"url(\"http://servo/test.png\") top left no-repeat, url(\"http://servo/test.png\") \
|
||||
let input = "url(\"http://servo/test.png\") top left no-repeat, url(\"http://servo/test.png\") \
|
||||
center / 100% 100% no-repeat, white";
|
||||
let result = parse(background::parse_value, input).unwrap();
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use style::parser::Parse;
|
||||
use style::properties::MaybeBoxed;
|
||||
use style::properties::longhands::{
|
||||
border_image_outset, border_image_repeat, border_image_slice, 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;
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ use crate::parsing::parse;
|
|||
#[test]
|
||||
fn negative_letter_spacing_should_parse_properly() {
|
||||
use style::properties::longhands::letter_spacing;
|
||||
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
|
||||
use style::values::specified::LetterSpacing;
|
||||
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
|
||||
|
||||
let negative_value = parse_longhand!(letter_spacing, "-0.5em");
|
||||
let expected = LetterSpacing(Spacing::Value(LengthPercentage::Length(
|
||||
|
@ -22,8 +22,8 @@ fn negative_letter_spacing_should_parse_properly() {
|
|||
#[test]
|
||||
fn negative_word_spacing_should_parse_properly() {
|
||||
use style::properties::longhands::word_spacing;
|
||||
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
|
||||
use style::values::specified::WordSpacing;
|
||||
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
|
||||
|
||||
let negative_value = parse_longhand!(word_spacing, "-0.5em");
|
||||
let expected = WordSpacing(Spacing::Value(LengthPercentage::Length(
|
||||
|
|
|
@ -23,21 +23,27 @@ fn test_cubic_bezier() {
|
|||
);
|
||||
|
||||
// p1x and p2x values must be in range [0, 1]
|
||||
assert!(parse(
|
||||
transition_timing_function::parse,
|
||||
"cubic-bezier(-1, 0, 0, 0"
|
||||
)
|
||||
.is_err());
|
||||
assert!(parse(
|
||||
transition_timing_function::parse,
|
||||
"cubic-bezier(0, 0, -1, 0"
|
||||
)
|
||||
.is_err());
|
||||
assert!(parse(
|
||||
transition_timing_function::parse,
|
||||
"cubic-bezier(-1, 0, -1, 0"
|
||||
)
|
||||
.is_err());
|
||||
assert!(
|
||||
parse(
|
||||
transition_timing_function::parse,
|
||||
"cubic-bezier(-1, 0, 0, 0"
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
assert!(
|
||||
parse(
|
||||
transition_timing_function::parse,
|
||||
"cubic-bezier(0, 0, -1, 0"
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
assert!(
|
||||
parse(
|
||||
transition_timing_function::parse,
|
||||
"cubic-bezier(-1, 0, -1, 0"
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
|
||||
assert!(parse(transition_timing_function::parse, "cubic-bezier(2, 0, 0, 0").is_err());
|
||||
assert!(parse(transition_timing_function::parse, "cubic-bezier(0, 0, 2, 0").is_err());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue