Closed Bug 1454525 Opened 7 years ago Closed 6 years ago

Touch event listener demo won't scroll in Firefox until you release the first touch

Categories

(Core :: DOM: Events, defect, P3)

defect

Tracking

()

RESOLVED INVALID
Tracking Status
firefox59 --- affected
firefox60 --- affected
firefox61 --- affected
firefox65 --- affected
firefox66 --- affected
firefox67 --- affected

People

(Reporter: cpeterson, Unassigned)

References

()

Details

(Keywords: parity-chrome)

@ Olli: Is this a bug in our passive touch listeners or a bug in the CodePen demo? STR: 1. Set "dom.event.default_to_passive_touch_listeners" pref to true. 2. Load https://codepen.io/alexreardon/pen/yKEKby 3. On a touch screen, press down on the blue frame with the "Can you use event.preventDefault() inside a dynamic event handler? Press your device and move to test" message. 4. While still pressing down, try to drag the frame up and down. RESULT: Nothing happens. The frame or text do not move in Firefox like they do in Chrome. If you release the press and press down again, then you can drag the frame up and down as expected. This test requires addEventListener support for passive and `once` event listeners, but I see the same Firefox behavior whether the "dom.event.default_to_passive_touch_listeners" pref is true or false. I see the same console log messages in both Firefox and Chrome: > touchstart fired > touchend fired > was event prevented? true Note that "touchend fired" is a test typo. It should read "touchmove fired".
Flags: needinfo?(bugs)
Priority: -- → P3
I can still reproduce this bug in Firefox 66. The "dom.event.default_to_passive_touch_listeners" pref is now true by default in Firefox 61 (bug 1454107), so this test's dragging problem is now the default behavior in Firefox.
See Also: → 1454107

I don't understand this. The test explicitly doesn't use passive listeners.

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(bugs)
Resolution: --- → INVALID

(In reply to Olli Pettay [:smaug] (massive needinfo queue, ping on IRC on anything urgent) from comment #2)

I don't understand this. The test explicitly doesn't use passive listeners.

Oops. I'm not sure how I missed the passive: false option. I don't recall where I found this CodePen test case.

However, with passive: false, I do still see Firefox and Chrome behave differently on my Windows touchscreen laptop as described in comment 0:

  1. On the first touchstart, Chrome and Firefox both change the "Press your device and move to test" message to "yeah! 🤘", but only Chrome will allow you to scroll the page while dragging on this first touch.
  2. If you touchend and then touchstart a second time, then Firefox will allow you to scroll the page by dragging.

Is this difference in behavior expected?

Flags: needinfo?(bugs)
See Also: 1454107
Summary: Passive touch event listener demo won't scroll in Firefox until you release the first touch → Touch event listener demo won't scroll in Firefox until you release the first touch

Chrome's behavior looks broken to me.

Flags: needinfo?(bugs)

And are you using a Chrome version which actually dispatches touch events :)

(In reply to Olli Pettay [:smaug] (massive needinfo queue, ping on IRC on anything urgent) from comment #5)

And are you using a Chrome version which actually dispatches touch events :)

I think so. The CodePen test listens for touchstart and touchmove events. It responds to my Windows touchscreen in Chrome and Firefox, but not to my trackpad clicks.

https://codepen.io/alexreardon/pen/yKEKby

You need to log in before you can comment on or make changes to this bug.