diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-10-04 18:33:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 16:33:18 +0000 |
commit | ce183d85818e4d9b64f45cc4d7203b1871b3182e (patch) | |
tree | 2ecff1ccbdf4f1d995bd44958c9a9f5d5099d9ab /components/layout/display_list/webrender_helpers.rs | |
parent | 38a325cc1c2a079c42b0511c2e5e5aa88753144d (diff) | |
download | servo-ce183d85818e4d9b64f45cc4d7203b1871b3182e.tar.gz servo-ce183d85818e4d9b64f45cc4d7203b1871b3182e.zip |
Only access hit test items for the current epoch in the compositor (#30491)
When display lists update quickly, a hit test result might be returned
for a previous display list / list of hit test items. When that happens,
ignore the hit test result.
This fixes a crash, but there might be situations where we can do
something better, such as wait for display list processing to finish
before performing the hit test. A future change might do this for events
like mouse clicks and touch events that should never be thrown away.
Ultimately, the best thing is likely moving hit testing back to layout
or script so a valid hit test can always be performed against the
current DOM.
Fixes #29796.
Diffstat (limited to 'components/layout/display_list/webrender_helpers.rs')
-rw-r--r-- | components/layout/display_list/webrender_helpers.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/layout/display_list/webrender_helpers.rs b/components/layout/display_list/webrender_helpers.rs index 1e584c0c06f..2a57789f341 100644 --- a/components/layout/display_list/webrender_helpers.rs +++ b/components/layout/display_list/webrender_helpers.rs @@ -7,6 +7,7 @@ // This might be achieved by sharing types between WR and Servo display lists, or // completely converting layout to directly generate WebRender display lists, for example. +use gfx_traits::WebRenderEpochToU16; use log::trace; use msg::constellation_msg::PipelineId; use script_traits::compositor::{CompositorDisplayListInfo, ScrollTreeNodeId, ScrollableNodeInfo}; @@ -190,7 +191,7 @@ impl DisplayItem { clip_id: ClipId::ClipChain(current_clip_chain_id), flags: PrimitiveFlags::default(), }, - (hit_test_index as u64, 0u16), + (hit_test_index as u64, state.compositor_info.epoch.as_u16()), ); }; |