Skip to content

Truly independent web browser

LibWeb: Walk past the end of the shadow root column

Andreas Klingdf9c13500b66
diff --git a/Libraries/LibWeb/Rust/src/css/style/pipeline/projection.rs b/Libraries/LibWeb/Rust/src/css/style/pipeline/projection.rs
index 5c1d3c7d41f..1f5cfa7a4f4 100644
--- a/Libraries/LibWeb/Rust/src/css/style/pipeline/projection.rs
+++ b/Libraries/LibWeb/Rust/src/css/style/pipeline/projection.rs
@@ -685,10 +685,11 @@ impl ProjectionGeneration {
return Some(slot);
}
let parent = row.links.parent?;
+ // NB: The column only reaches as far as the last element that has a shadow root.
let host = self
.shadows
- .get(parent.element_slot())?
- .as_deref()
+ .get(parent.element_slot())
+ .and_then(Option::as_deref)
.and_then(|shadow| shadow.host);
Some(host.unwrap_or(parent))
}