diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 707b7ce06b6..302ac340f09 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -292,13 +292,7 @@ impl CompositorLayer for Layer { delta: TypedPoint2D, cursor: TypedPoint2D) -> ScrollEventResult { - // If this layer doesn't want scroll events, neither it nor its children can handle scroll - // events. - if self.wants_scroll_events() != WantsScrollEventsFlag::WantsScrollEvents { - return ScrollEventResult::ScrollEventUnhandled; - } - - //// Allow children to scroll. + // Allow children to scroll. let scroll_offset = self.extra_data.borrow().scroll_offset; let new_cursor = cursor - scroll_offset; for child in self.children().iter() { @@ -311,6 +305,11 @@ impl CompositorLayer for Layer { } } + // If this layer doesn't want scroll events, it can't handle scroll events. + if self.wants_scroll_events() != WantsScrollEventsFlag::WantsScrollEvents { + return ScrollEventResult::ScrollEventUnhandled; + } + self.clamp_scroll_offset_and_scroll_layer(scroll_offset + delta) }