Closed Bug 2086786 Opened 24 days ago Closed 18 days ago

preventDefault on wheel events intermittently ignored

Categories

(Core :: Panning and Zooming, defect, P2)

All
macOS
defect

Tracking

()

VERIFIED FIXED
161 Branch
Tracking Status
firefox-esr153 --- unaffected
firefox159 --- wontfix
firefox160 --- verified
firefox161 --- verified

People

(Reporter: mstange, Assigned: botond)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 3 external files, 1 obsolete file)

Steps to reproduce:

  1. Be on macOS
  2. Go to attachment 8425744 [details]
  3. Put your mouse over the circle.
  4. Do a fling to scroll down, try multiple times.

Expected results:
The entire scroll gesture should be ignored, because the red area calls preventDefault() on wheel events.

Actual results:
There's often one event that gets through, when the finger is lifted from the mouse / touchpad, i.e. as it transitions into momentum wheel event mode.

Set release status flags based on info from the regressing bug 2072785

:botond, since you are the author of the regressor, bug 2072785, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

I didn't specify the log level for inputqueue so that the last log didn't include the one which I believe the most important part.

Attachment #9670879 - Attachment is obsolete: true

From the log:

``
[GPU 57525: Main Thread]: D/apz.inputqueue transmogrifying pan input 4 to PANGESTURE_START for new block 0
[GPU 57525: Main Thread]: D/apz.manager Found target 10d322000 using ancestor lookup
[GPU 57525: Main Thread]: D/apz.manager OverscrollHandoffChain[0] = 10d3da000
[GPU 57525: Main Thread]: D/apz.manager OverscrollHandoffChain[1] = 10d322000
[GPU 57525: Main Thread]: D/apz.inputqueue started new pan gesture block 10845cc20 id 8 for target 10d3da000
[GPU 57525: Main Thread]: D/apz.inputqueue scheduling main thread timeout for target 10d3da000
[GPU 57525: Main Thread]: V/apz.controller 10d3da000(root scrollId=2): CanScroll: event delta is (0,0)
[GPU 57525: Main Thread]: V/apz.controller 10d322000(subframe scrollId=2): CanScroll: event delta is (0,0)
[GPU 57525: Main Thread]: D/apz.inputqueue skip processing pan gesture block 10845cc20; target-confirmed: 0 content-responded: 0 content-response-expi red: 0 waiting-browser-gesture-response: 0 waiting-content-response: 0
[GPU 57525: Main Thread]: D/apz.manager Maybe override txn (0x10845cc20)
[GPU 57525: Main Thread]: D/apz.manager Maybe override layers id (0x1e00000000) -> (0x1e00000000)
[GPU 57525: Main Thread]: D/apz.inputqueue got a target apzc; block=8 guid={ l=0x1e00000000, p=3, v=2 }
[GPU 57525: Main Thread]: D/apz.manager Found target 10d322000 using ancestor lookup
[GPU 57525: Main Thread]: D/apz.manager OverscrollHandoffChain[0] = 10d3da000
[GPU 57525: Main Thread]: D/apz.manager OverscrollHandoffChain[1] = 10d322000
[GPU 57525: Main Thread]: V/apz.controller 10d3da000(root scrollId=2): CanScroll: event delta is (0,0)
[GPU 57525: Main Thread]: V/apz.controller 10d322000(subframe scrollId=2): CanScroll: event delta is (0,0)
[GPU 57525: Main Thread]: D/apz.inputqueue skip processing pan gesture block 10845cc20; target-confirmed: 1 content-responded: 0 content-response-expi red: 0 waiting-browser-gesture-response: 0 waiting-content-response: 0
[GPU 57525: Main Thread]: D/apz.inputqueue got a content response; block=8 preventDefault=0

This is the cause, the block=8 was not preventDefaulted.
Assignee: nobody → botond
Attachment #9670883 - Attachment description: WIP: Bug 2086786 - A mochitest demonstrating a hypothesis for how the bug might occur → WIP: Bug 2086786 - Test + fix for a hypothetical mechanism for the bug
Status: NEW → ASSIGNED

@botond, could this be triaged for severity?

Going to call this one an S2. I'm planning to have a fix that's confirmed to work up for review today.

Severity: -- → S2
Flags: needinfo?(botond)
Priority: -- → P2
Attachment #9670883 - Attachment description: WIP: Bug 2086786 - Test + fix for a hypothetical mechanism for the bug → Bug 2086786 - Guard against a zero-delta pan-start event causing APZ to let a scroll through when content is preventDefault-ing wheel events. r=hiro,mstange
Pushed by bballo@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b0e87da00a5f https://hg.mozilla.org/integration/autoland/rev/c91352f7593c Guard against a zero-delta pan-start event causing APZ to let a scroll through when content is preventDefault-ing wheel events. r=mac-reviewers,bradwerth,hiro https://github.com/mozilla-firefox/firefox/commit/84da89381479 https://hg.mozilla.org/integration/autoland/rev/bca537b93a13 Guard against a zero-delta pan-end event causing APZ to let a (momentum) scroll through when content is preventDefault-ing wheel events. r=hiro
Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch

The patch landed in nightly and beta is affected.

:botond, please make an uplift decision for beta:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox160 to wontfix if the fix can wait for the next release.

Uplift requests can be submitted from Lando: D337809, D339005.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(botond)

To add to comment 11, it's too late for Fx160 beta and RC build, but we could include it in the planned dot release if you add a release uplift request

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: When touchpad scrolling on a page that intends to handle all scroll gestures itself by using an active wheel listener that calls preventDefault() on every event, occasionally an event can incorrectly get through to default handling (scrolling) by the browser.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: medium
  • Explanation of risk level: This area of the code is tricky and historically prone to regressions. However, the risk of a serious regression is low due to having accumulated significant test coverage (and it would be noticed quickly on the nightly channel).
  • String changes made/needed?: none
  • Is Android affected?: no
Attachment #9674508 - Flags: approval-mozilla-release?

Requested 160 uplift. To minimize risk, I only requested uplift for the second patch (about zero-delta pan-events) since that's the one we understand to be causing the user-visible symptoms here.

Flags: needinfo?(botond)
QA Whiteboard: [qa-triage-done-c162/b161][qa-ver-needed-c162/b161]
Flags: qe-verify+
QA Whiteboard: [qa-triage-done-c162/b161][qa-ver-needed-c162/b161] → [qa-triage-done-c162/b161][qa-ver-needed-c162/b161][uplift]

Reproduced this issue on macOS 13 using Firefox Nightly 161.0a1 (2026-10-28), not only the white ball was rotated, but the entire page scrolls, when the mouse is over the circle and scrolling with the touchpad.
Verified as fixed on latest Firefox Nightly 162.0a1 (2026-11-10) and Firefox 161.0b1 with macOS 13, Ubuntu 26 and Windows 11 the issue no longer persists, now only the white ball is rotated when the mouse is over the circle and scrolling with the touchpad.

QA Whiteboard: [qa-triage-done-c162/b161][qa-ver-needed-c162/b161][uplift] → [qa-triage-done-c162/b161][qa-ver-done-c162/b161][uplift]
QA Contact: tzsoldos
Attachment #9674508 - Flags: approval-mozilla-release? → approval-mozilla-release+

Verified as fixed on Firefox 160.0.1 with macOS 13, Ubuntu 24 and Windows 11 the issue no longer persists, now only the white ball is rotated when the mouse is over the circle and scrolling with the touchpad.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: