Closed Bug 1615824 Opened 5 years ago Closed 5 years ago

e.touches or e.changedTouches at touchend has no values

Categories

(DevTools :: Responsive Design Mode, defect, P3)

73 Branch
defect

Tracking

(firefox-esr68 unaffected, firefox75 wontfix, firefox76 wontfix, firefox77 fixed)

RESOLVED FIXED
Firefox 77
Tracking Status
firefox-esr68 --- unaffected
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- fixed

People

(Reporter: ooijunxiang0959, Assigned: mtigley, NeedInfo)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0

Steps to reproduce:

add event listener touchend and log the event object.

Actual results:

touches and changedTouches has no values

Expected results:

those should return a touchList

Hi ooijunxiang!
Could you please add more exact steps to test this.
Also, you can try to reproduce this problem on the latest Firefox Nightly and tell us your input. You can download it from here: https://nightly.mozilla.org/

Flags: needinfo?(ooijunxiang0959)

alri(In reply to Marcela from comment #1)

Hi ooijunxiang!
Could you please add more exact steps to test this.
Also, you can try to reproduce this problem on the latest Firefox Nightly and tell us your input. You can download it from here: https://nightly.mozilla.org/

alright will try and tell the result here

Flags: needinfo?(ooijunxiang0959)

I am experiencing the same bug in:

  • Firefox 73.0.1
  • Firefox Developer Edition 74.0b6
  • Firefox 75.0a1 (2020-02-22)

I think e.touches is always empty with the touchend event. The e.changedTouches property should not be empty though. It should list all last touches instead:

For the touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface). - https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/changedTouches

So it seems like the current behavior is not intended.

Using mozregression I found the commit that is responsible for this behavior:

2020-02-23T00:37:42: INFO : Narrowed integration regression window from [d32c29ee, 10ed3627] (3 builds) to [2a832a6a, 10ed3627] (2 builds) (~1 steps left)
2020-02-23T00:37:42: DEBUG : Starting merge handling...
2020-02-23T00:37:42: DEBUG : Using url: https://hg.mozilla.org/integration/autoland/json-pushes?changeset=10ed362716f0c03160f700bbeb4e3f5d832c67b0&full=1
2020-02-23T00:37:43: DEBUG : Found commit message:
Bug 1588438 - Refactor deprecated touch event APIs. r=ochameau

This revision refactors RDM's touch simulator to use modern touch web APIs where possible.

Differential Revision: https://phabricator.services.mozilla.com/D50147

2020-02-23T00:37:43: DEBUG : Did not find a branch, checking all integration branches
2020-02-23T00:37:43: INFO : The bisection is done.
2020-02-23T00:37:43: INFO : Stopped

Steps to reproduce:

  1. have events 'touchstart' and 'touchend' on an element.
  2. open dev tools and toggle responsive design mode
  3. trigger and log the event and find 'touches' or 'changedTouches' property
  4. it should return a value but instead it is blank. ( other browsers work but not firefox )

I changed product and component..
DOM: Core & HTML team, if this is not the right component please feel free to route this ticket to the corresponding team, thanks!

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

Do you have a test case for this?

Flags: needinfo?(ooijunxiang0959)

I was going to open "Touch Simulation in Responsive Design Mode of Developer Tools does not define changedTouches in touchend", then was suggested this issue.
I think it might be limited to the touch-simulator, as the error does not occur with actual touch events (with or without Touch Simulation).
The error message I get:
TypeError: e.changedTouches[0] is undefined
<anonymous> test.html:909
sendTouchEvent resource://devtools/server/actors/emulation/touch-simulator.js:364
handleEvent resource://devtools/server/actors/emulation/touch-simulator.js:277

https://jsfiddle.net/Lyvwb4f3/ can be used to test, it does console.log(e.changedTouches[0]);on touchend of the red div (it was originally created for my other bug report).

Please file devtools related issues separately.
As far as I know, touch simulation doesn't use basically any of the core touch event handling code.

Or is this bug all about devtools?
If that is the case, then the component is wrong.

The component is wrong. This should belong to „DevTools“ → „Responsive Design Mode“ because that’s where the touch events get simulated but lack the list of changedTouches for some versions now. Please see my mozregression output for more details on the cause of this bug.

Component: DOM: Core & HTML → Responsive Design Mode
Product: Core → DevTools
Regressed by: 1588438
Has Regression Range: --- → yes
Blocks: rdm-touch

We'll use the fiddle at https://jsfiddle.net/Lyvwb4f3/ as a testcase.

Priority: -- → P3

This issue looks to be fixed when Bug 1625934 landed in Nightly. So I'll be closing this. Feel free to re-open if this is not the case.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Assignee: nobody → mtigley
Depends on: 1625934
Target Milestone: --- → Firefox 77
You need to log in before you can comment on or make changes to this bug.