script: Move point_in_initial_containing_block calculation to script (#38520)

Instead of calculating this value in the compositor, calculate it in
`ScriptThread` now that it is straightforward to get this value from the
layout spatial tree. This allows removing some tricky callback code in
the Compositor.

Testing: This shouldn't change any observable behavior so is covered by
existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-08-11 11:32:38 +02:00 committed by GitHub
parent 9d4004135b
commit 005164df4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 53 deletions

View file

@ -337,11 +337,10 @@ impl WebViewRenderer {
};
// If we can't find a pipeline to send this event to, we cannot continue.
let get_pipeline_details = |pipeline_id| self.pipelines.get(&pipeline_id);
let Some(result) = self
.global
.borrow()
.hit_test_at_point(point, get_pipeline_details)
.hit_test_at_point(point)
.into_iter()
.nth(0)
else {
@ -852,12 +851,10 @@ impl WebViewRenderer {
ScrollLocation::Start | ScrollLocation::End => scroll_location,
};
let get_pipeline_details = |pipeline_id| self.pipelines.get(&pipeline_id);
let hit_test_results = self.global.borrow().hit_test_at_point_with_flags(
cursor,
HitTestFlags::FIND_ALL,
get_pipeline_details,
);
let hit_test_results = self
.global
.borrow()
.hit_test_at_point_with_flags(cursor, HitTestFlags::FIND_ALL);
// Iterate through all hit test results, processing only the first node of each pipeline.
// This is needed to propagate the scroll events from a pipeline representing an iframe to