Closed Bug 1160418 Opened 9 years ago Closed 6 years ago

B2G: MouseEvent.buttons returns 0 for taps while Fennec returns 1

Categories

(Core :: DOM: Events, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox40 --- affected

People

(Reporter: kohei, Unassigned)

Details

(Keywords: site-compat, testcase)

Attachments

(1 file, 1 obsolete file)

I have recently noticed that my BzDeck app doesn't respond to tap gestures on B2G Nightly. My debugging finds that event.buttons now returns 0 instead of 1. Maybe 0 is correct in theory because it's not triggered by the mouse left button, but this property should return 1 for site compatibility. Firefox for Android still returns 1 for taps.

https://github.com/bzdeck/bzdeck/issues/269
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
Summary: B2G: event.buttons now returns 0 instead of 1 → B2G: MouseEvent.buttons now returns 0 instead of 1
Is this reproducing on a particular device or the emulator?
Flags: needinfo?(kohei.yoshino)
Attached file testcase (obsolete) —
I'm on a Flame phone. I have already worked around the issue in the BzDeck code so it can no longer be reproduced on the app. Here's a pretty simple testcase to see the MouseEvent.buttons value.
Flags: needinfo?(kohei.yoshino)
Here's my results:

* Mac: 1
* Android: 1
* Firefox OS: 0
Attached file testcase
Check both MouseEvent.button and MouseEvent.buttons...
Attachment #8601640 - Attachment is obsolete: true
Thanks, the testcase works for me.

Desktop Firefox 40.0a1 returns 1 on click.
B2G 2.2.0.0-pre on my Nexus 4 returns 0 on tap.

I don't have my Flame handy and am away from the office for the next week. I can try to regress this when I get back. Kohei, it would save us some time if you want to take a crack at regressing this.
Keywords: testcase
I'll check for the regression range. Not so long time ago.
Hmm. Looks like it's not a recent regression or maybe not a regression.

Actually the Firefox OS system and some apps on my Flame phone had not got updated for a month or so for some reason until I flashed them manually, so the possible scenario is BzDeck was also old and therefore it was working even after I change my code late March:

https://github.com/bzdeck/flaretail.js/commit/77b36a2562ee40ded9a6789a00787659bfe34a7f

But, anyway, the current B2G behaviour doesn't match Fennec. Or, B2G might be right and Fennec should also return 0 for taps, though I guess it's returning 1 for a compatibility reason.
Summary: B2G: MouseEvent.buttons now returns 0 instead of 1 → B2G: MouseEvent.buttons returns 0 for taps while Fennec returns 1
Closing as B2G is obsolete.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: