From 50d31686beb7292e9c265f3c375254c76a2c87d7 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Tue, 15 Aug 2023 03:55:50 +0200 Subject: [PATCH] Further changes required by Servo --- tests/unit/style/lib.rs | 2 -- tests/unit/style/specified_values.rs | 50 ---------------------------- 2 files changed, 52 deletions(-) delete mode 100644 tests/unit/style/specified_values.rs diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index c87c8fbc370..519255b9209 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -18,7 +18,6 @@ extern crate servo_atoms; extern crate servo_url; #[macro_use] extern crate size_of_test; -#[macro_use] extern crate style; extern crate style_traits; extern crate test; @@ -31,7 +30,6 @@ mod parsing; mod properties; mod rule_tree; mod size_of; -mod specified_values; mod str; mod stylesheets; mod stylist; diff --git a/tests/unit/style/specified_values.rs b/tests/unit/style/specified_values.rs deleted file mode 100644 index d5c061ab502..00000000000 --- a/tests/unit/style/specified_values.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* 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 https://mozilla.org/MPL/2.0/. */ - -use style; - -#[cfg(all(test, target_pointer_width = "64"))] -#[test] -fn size_of_specified_values() { - use std::mem::size_of; - let threshold = 24; - - let mut bad_properties = vec![]; - - macro_rules! check_property { - ( $( { $name: ident, $boxed: expr } )+ ) => { - $( - let size = size_of::(); - let is_boxed = $boxed; - if (!is_boxed && size > threshold) || (is_boxed && size <= threshold) { - bad_properties.push((stringify!($name), size, is_boxed)); - } - )+ - } - } - - longhand_properties_idents!(check_property); - - let mut failing_messages = vec![]; - - for bad_prop in bad_properties { - if !bad_prop.2 { - failing_messages.push( - format!("Your changes have increased the size of {} SpecifiedValue to {}. The threshold is \ - currently {}. SpecifiedValues affect size of PropertyDeclaration enum and \ - increasing the size may negative affect style system performance. Please consider \ - using `boxed=\"True\"` in this longhand.", - bad_prop.0, bad_prop.1, threshold)); - } else if bad_prop.2 { - failing_messages.push( - format!("Your changes have decreased the size of {} SpecifiedValue to {}. Good work! \ - The threshold is currently {}. Please consider removing `boxed=\"True\"` from this longhand.", - bad_prop.0, bad_prop.1, threshold)); - } - } - - if !failing_messages.is_empty() { - panic!("{}", failing_messages.join("\n\n")); - } -}