diff --git a/Cargo.lock b/Cargo.lock
index ed2efc3d27d..354a7cd78a7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4725,6 +4725,7 @@ dependencies = [
"servo_geometry",
"servo_malloc_size_of",
"servo_url",
+ "smallvec",
"stylo",
"stylo_atoms",
"stylo_traits",
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index bb500d6f98c..28dde5fdea5 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -52,6 +52,7 @@ servo_arc = { workspace = true }
servo_config = { path = "../config" }
servo_geometry = { path = "../geometry" }
servo_url = { path = "../url" }
+smallvec = { workspace = true }
stylo = { workspace = true }
stylo_atoms = { workspace = true }
stylo_traits = { workspace = true }
diff --git a/components/layout/dom.rs b/components/layout/dom.rs
index 124bc9269b6..6617c4a2053 100644
--- a/components/layout/dom.rs
+++ b/components/layout/dom.rs
@@ -18,6 +18,7 @@ use malloc_size_of_derive::MallocSizeOf;
use net_traits::image_cache::Image;
use script::layout_dom::ServoLayoutNode;
use servo_arc::Arc as ServoArc;
+use smallvec::SmallVec;
use style::context::SharedStyleContext;
use style::properties::ComputedValues;
use style::selector_parser::{PseudoElement, RestyleDamage};
@@ -32,26 +33,35 @@ use crate::replaced::CanvasInfo;
use crate::table::TableLevelBox;
use crate::taffy::TaffyItemBox;
+#[derive(MallocSizeOf)]
+pub struct PseudoLayoutData {
+ pseudo: PseudoElement,
+ box_slot: ArcRefCell