aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2023-08-14 23:00:08 +0200
committerMartin Robinson <mrobinson@igalia.com>2023-08-16 17:46:41 +0200
commita7699d9034ca7f1019dd5a568e0006e4a996c2bf (patch)
treecf07ea710a61115eaec0c96aa8942855591caee9 /components/layout
parentf48b95e2e3879d38314ab84999f0c17055a660d5 (diff)
downloadservo-a7699d9034ca7f1019dd5a568e0006e4a996c2bf.tar.gz
servo-a7699d9034ca7f1019dd5a568e0006e4a996c2bf.zip
Further changes required by Servo
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/Cargo.toml4
-rw-r--r--components/layout/fragment.rs7
-rw-r--r--components/layout/lib.rs2
-rw-r--r--components/layout/tests/size_of.rs21
4 files changed, 10 insertions, 24 deletions
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index d11f508c502..fe501517c6e 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -44,6 +44,7 @@ servo_atoms = { path = "../atoms" }
servo_config = { path = "../config" }
servo_geometry = { path = "../geometry" }
servo_url = { path = "../url" }
+size_of_test = { path = "../size_of_test" }
smallvec = { workspace = true, features = ["union"] }
style = { path = "../style", features = ["servo"] }
style_traits = { path = "../style_traits" }
@@ -52,6 +53,3 @@ unicode-script = { workspace = true }
webrender_api = { workspace = true }
xi-unicode = { workspace = true }
-[dev-dependencies]
-size_of_test = { path = "../size_of_test" }
-
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 5cf56b6cbdf..7f36e110499 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -158,6 +158,11 @@ pub struct Fragment {
pub established_reference_frame: Option<ClipScrollNodeIndex>,
}
+#[cfg(debug_assertions)]
+size_of_test!(Fragment, 176);
+#[cfg(not(debug_assertions))]
+size_of_test!(Fragment, 152);
+
impl Serialize for Fragment {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut serializer = serializer.serialize_struct("fragment", 3)?;
@@ -212,6 +217,8 @@ pub enum SpecificFragmentInfo {
TruncatedFragment(Box<TruncatedFragmentInfo>),
}
+size_of_test!(SpecificFragmentInfo, 24);
+
impl SpecificFragmentInfo {
fn restyle_damage(&self) -> RestyleDamage {
let flow = match *self {
diff --git a/components/layout/lib.rs b/components/layout/lib.rs
index 3f41157c1cd..aab98048a54 100644
--- a/components/layout/lib.rs
+++ b/components/layout/lib.rs
@@ -16,6 +16,8 @@ extern crate log;
extern crate range;
#[macro_use]
extern crate serde;
+#[macro_use]
+extern crate size_of_test;
#[macro_use]
pub mod layout_debug;
diff --git a/components/layout/tests/size_of.rs b/components/layout/tests/size_of.rs
deleted file mode 100644
index dec10937177..00000000000
--- a/components/layout/tests/size_of.rs
+++ /dev/null
@@ -1,21 +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/. */
-
-#![cfg(target_pointer_width = "64")]
-
-#[macro_use]
-extern crate size_of_test;
-
-use layout_2013::Fragment;
-use layout_2013::SpecificFragmentInfo;
-
-#[cfg(debug_assertions)]
-size_of_test!(test_size_of_fragment, Fragment, 176);
-#[cfg(not(debug_assertions))]
-size_of_test!(test_size_of_fragment, Fragment, 152);
-size_of_test!(
- test_size_of_specific_fragment_info,
- SpecificFragmentInfo,
- 24
-);