mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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.
This commit is contained in:
parent
38a325cc1c
commit
ce183d8581
4 changed files with 35 additions and 3 deletions
|
@ -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()),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue