From 7dc48460d2cda1a39c08d256d4eb47ada2f92e4f Mon Sep 17 00:00:00 2001 From: Fuguo <1782765876@qq.com> Date: Sat, 23 Aug 2025 15:00:14 +0800 Subject: [PATCH] layout: Skip adding `ScrollFrameHitTestItem` to stacking context tree if the `BoxFragment` has inherited style `pointer-events: none` (#38884) **fix some page cannot slide** In the refactoring of https://github.com/servo/servo/pull/38480, a segment of logic was missing. https://github.com/servo/servo/blob/11844ca5af97999f35b12d082ea9bfda9d18a74a/components/layout/display_list/mod.rs#L405-L410 Testing: The page can be scrolled on the OpenHarmony device. Fixes: https://github.com/servo/servo/pull/38480#issuecomment-3213734994 --------- Signed-off-by: kongbai1996 <1782765876@qq.com> Signed-off-by: Fuguo <1782765876@qq.com> Co-authored-by: Euclid Ye --- .../layout/display_list/stacking_context.rs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/components/layout/display_list/stacking_context.rs b/components/layout/display_list/stacking_context.rs index 0b2241e20c3..d51b0685a2a 100644 --- a/components/layout/display_list/stacking_context.rs +++ b/components/layout/display_list/stacking_context.rs @@ -1480,14 +1480,18 @@ impl BoxFragment { sensitivity, ); - stacking_context_tree - .hit_test_items - .push(ScrollFrameHitTestItem { - scroll_node_id: *parent_scroll_node_id, - clip_id, - rect: scroll_frame_rect, - external_scroll_id, - }); + use style::computed_values::pointer_events::T as PointerEvents; + + if self.style.get_inherited_ui().pointer_events != PointerEvents::None { + stacking_context_tree + .hit_test_items + .push(ScrollFrameHitTestItem { + scroll_node_id: *parent_scroll_node_id, + clip_id, + rect: scroll_frame_rect, + external_scroll_id, + }); + } Some(OverflowFrameData { clip_id,