[Webkit-unassigned] [Bug 280085] New: Wheel event with preventDefault() and DOM updates not preventing page scroll

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 20 14:12:54 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=280085

            Bug ID: 280085
           Summary: Wheel event with preventDefault() and DOM updates not
                    preventing page scroll
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: macOS 14
            Status: NEW
          Severity: Major
          Priority: P2
         Component: Scrolling
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: erjona.topalli at oracle.com
                CC: simon.fraser at apple.com,
                    webkit-unassigned at lists.webkit.org

Platform:  Tested on macOS Safari 17.6

Problem Description:

Consider the scenario where an element is inside of a page that is scrollable. A wheel event handler is attached to the element, and event.preventDefault() is called inside the handler. When wheel gesture is initiated over the element, then the page should never scroll.
We find that if the wheel event handler also performs sufficiently large number of DOM operations, then the page may scroll even if the event.preventDefault() is called. This is not observed on latest Chrome (v128) and Edge (v128). For context, we encountered this when we tried to build a SVG based visualization. When wheel gesture is initiated over the visualization, we want to prevent the page from scrolling and perform a zoom operation. During zoom we perform svg DOM operations to change the view to reflect the zoom. On Safari, when the visualization is heavy enough, the page annoyingly jumps during the wheel zoom, which in some cases prevents the zoom from even happening. The desired behavior is the page never jumps, and the visualization just takes whatever time it needs to update during the wheel zoom, which is the behavior we observe on Chromium based browsers.
Steps to reproduce:
1. Go to this codepen: https://codepen.io/wlouie1/pen/wvLVxaM
2. Scroll inside the gray component container

Expected Result:
The page should not scroll because of the wheel event.preventDefault()
Actual Result:
The page scrolls after a large number of continuous wheel events within the gray component container, despite the preventDefault.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240920/417558a3/attachment.htm>


More information about the webkit-unassigned mailing list