servo/components/layout/Cargo.toml
Martin Robinson 11844ca5af
layout: Add a layout hit test and use it for document.elementsFromPoint (#38463)
In #18933, hit testing was moved from layout to WebRender. This presents
some issues. For instance, the DOM can change at the same time that hit
test is happening. This can mean that hit test returns references to
defunct DOM nodes, introducing memory safety issues. Currently, Servo
will try to ensure that the epochs used for testing and those recorded
in the DOM match, but this is not very reliable and has led to code that
retries failed hit tests.

This change reintroduces (8 years later) a layout hit tester and turns
it on for `document.elementFromPoint` and `document.elementsFromPoint`.
The idea is that this hit tester will gradually replace the majority of
the WebRender hit testing happening in the renderer.

Testing: This shouldn't really change the behavior hit testing, but it
seems to improve one WPT test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: kongbai1996 <1782765876@qq.com>
2025-08-05 09:48:21 +00:00

70 lines
1.9 KiB
TOML

[package]
name = "layout"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
rust-version.workspace = true
[lib]
name = "layout"
path = "lib.rs"
test = true
doctest = false
[features]
tracing = ["dep:tracing"]
[dependencies]
app_units = { workspace = true }
atomic_refcell = { workspace = true }
base = { workspace = true }
bitflags = { workspace = true }
compositing_traits = { workspace = true }
data-url = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
fnv = { workspace = true }
fonts = { path = "../fonts" }
fonts_traits = { workspace = true }
fxhash = { workspace = true }
html5ever = { workspace = true }
icu_locid = { workspace = true }
icu_segmenter = { workspace = true }
ipc-channel = { workspace = true }
itertools = { workspace = true }
kurbo = { workspace = true }
layout_api = { workspace = true }
log = { workspace = true }
malloc_size_of = { workspace = true }
malloc_size_of_derive = { workspace = true }
net_traits = { workspace = true }
parking_lot = { workspace = true }
pixels = { path = "../pixels" }
profile_traits = { workspace = true }
range = { path = "../range" }
rayon = { workspace = true }
script = { path = "../script" }
script_traits = { workspace = true }
selectors = { workspace = true }
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 }
taffy = { workspace = true }
tracing = { workspace = true, optional = true }
unicode-bidi = { workspace = true }
unicode-script = { workspace = true }
url = { workspace = true }
webrender_api = { workspace = true }
xi-unicode = { workspace = true }
servo-tracing = { workspace = true }
[dev-dependencies]
num-traits = { workspace = true }
quickcheck = "1"