ASSERTION: deltaX or deltaY must be non-zero: 'wheelEvent.deltaX || wheelEvent.deltaY'

RESOLVED FIXED in Firefox 43

Status

()

Core
Widget: Gtk
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: tromey, Assigned: roc)

Tracking

unspecified
mozilla43
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox43 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
I've been seeing this assertion recently:

[Parent 20679] ###!!! ASSERTION: deltaX or deltaY must be non-zero: 'wheelEvent.deltaX || wheelEvent.deltaY', file /home/tromey/firefox-git/tree-2/widget/gtk/nsWindow.cpp, line 3063


I'm building on x86-64 Fedora 22.
Mostly I am doing builds based on fx-team.
I presume this is using Gtk3, but I haven't checked.
I'm building with --enable-optimize --enable-debug.

I can reproduce the problem quite easily -- nearly every time I
use the scroll wheel on my mouse, I will hear a beep and see this
assertion in the terminal.
I saw it today on my B2G-desktop build, running on ubuntu 14.04 LTS.
I can reproduce this assertion 100% reliably in a debug mozilla-central build from today, with a fresh profile & no patches of my own applied, by following these STR:
 1. Visit about:blank
 2. Move mouse cursor off of the Firefox window.
 3. Move mouse cursor back over the Firefox window (in the middle somewhere).
 4. Try to scroll down with mouse scrollwheel.

This produces a single "ASSERTION: deltaX or deltaY must be non-zero" in my terminal. Subsequent scrolling doesn't cause more assertions, until I move the mouse away from & back over the Firefox window. (steps 2 and 3)
This assertion dates back to this cset from 2012 for bug 719320:
  http://hg.mozilla.org/mozilla-central/rev/e9a626db6c69#l1.93
Depends on: 719320
The assertion means that GTK widget dispatches unnecessary WidgetWheel event. The event doesn't cause any DOM events nor default actions.
As far as I can tell, GTK3 really is sending events with 0 in delta_x/delta_y. We should just remove the assertion.
Created attachment 8654699 [details]
MozReview Request: Bug 1191293. Remove harmless assertion that is triggered by GTK3. r=masayuki

Bug 1191293. Remove harmless assertion that is triggered by GTK3. r=masayuki
Attachment #8654699 - Flags: review?(masayuki)
Comment on attachment 8654699 [details]
MozReview Request: Bug 1191293. Remove harmless assertion that is triggered by GTK3. r=masayuki

https://reviewboard.mozilla.org/r/17745/#review15839

::: widget/gtk/nsWindow.cpp
(Diff revision 1)
> -    NS_ASSERTION(wheelEvent.deltaX || wheelEvent.deltaY,
> -                 "deltaX or deltaY must be non-zero");

Why don't you just ignore the unnecessary events? Even if you dispatch the wheel events, they won't be dispatched as DOM events into the DOM tree. So, the unnecessary events cause unnecessary IPCs.
Attachment #8654699 - Flags: review?(masayuki)
https://reviewboard.mozilla.org/r/17745/#review15839

> Why don't you just ignore the unnecessary events? Even if you dispatch the wheel events, they won't be dispatched as DOM events into the DOM tree. So, the unnecessary events cause unnecessary IPCs.

I'd prefer to avoid assuming here that deltaX==0 and deltaY==0 means the event can be ignored. For example, if they're zero but deltaZ is not zero, can the event be ignored? It's simpler to not make that assumption here and leave DOM code responsible for deciding which events can be ignored.
Assignee: nobody → roc
Comment on attachment 8654699 [details]
MozReview Request: Bug 1191293. Remove harmless assertion that is triggered by GTK3. r=masayuki

Bug 1191293. Remove harmless assertion that is triggered by GTK3. r=masayuki
Attachment #8654699 - Flags: review?(masayuki)
https://reviewboard.mozilla.org/r/17745/#review15839

> I'd prefer to avoid assuming here that deltaX==0 and deltaY==0 means the event can be ignored. For example, if they're zero but deltaZ is not zero, can the event be ignored? It's simpler to not make that assumption here and leave DOM code responsible for deciding which events can be ignored.

Okay, I think that in another bug, we should create a method to check if widget should dispatch a wheel event. Until then, it's okay to remove this.
Comment on attachment 8654699 [details]
MozReview Request: Bug 1191293. Remove harmless assertion that is triggered by GTK3. r=masayuki

https://reviewboard.mozilla.org/r/17745/#review16983
Attachment #8654699 - Flags: review?(masayuki) → review+
https://hg.mozilla.org/mozilla-central/rev/827a12863a6c
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox43: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.