Closed Bug 1506497 Opened 2 years ago Closed 2 years ago

touch-action is not working when event is registered


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

63 Branch



Tracking Status
firefox67 --- fixed


(Reporter: jongmoon.yoon, Assigned: kats)




(3 files)

Attached file test.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36

Steps to reproduce:

Although the touch-action: none is specified on element, scroll is working in some situation.

More exact information reference the attached example html file.

1. following HTML structure

<div class="pics">
  <div class="content"></div> // ...
<div class="overlay" style="touch-action:none">
  <div class="box"></div>
2. register touchEvent on ".overlay"
document.querySelector(".overlay").addEventListener("touchstart", () => {});

3. open page & drag box(".box")

Actual results:

scroll is activated although touch-action is none.

Expected results:

scroll should be deactivated.
This issue is triggered by following "hammer.js" issue.
Botond this looks similar to bug 1501382. Is it a dupe?
Ever confirmed: true
Flags: needinfo?(botond)
No, I think it's different issue although it may share same reason internally.

My point is "touch-action:none" is not working only if event handler is registered on that element.
(In reply to Kevin Brosnan [:kbrosnan] from comment #3)
> Botond this looks similar to bug 1501382. Is it a dupe?

Bug 1501382 talks about opacity:0 divs, and there is no use of opacity in this testcase, so I'd say not a dupe.
Flags: needinfo?(botond)
Component: General → Panning and Zooming
Product: Firefox for Android → Core
Version: Firefox 63 → 63 Branch
I think this is likely because the overlay and box divs are both fixed-position. So when we walk up from the box using the frame tree in the main thread fallback (triggered by the event listeners) at [1] it doesn't walk through the overlay and so doesn't see the touch-action property.

A workaround is to also set touch-action:none on the box div. Or if you can make the event listeners passive that should work too.

Priority: -- → P3
Per docs at using GetInFlowParent instead of GetParent might fix this, but I didn't try it.
Assignee: nobody → kats

When walking up the frame parent chain to compute the touch-action on an
element, we should use the in-flow parent. This produces different
values for out-of-flow frames (e.g. fixed-position frames). This is more
in line with the actual spec for touch-action, which propagates down the

Pushed by
Walk up to the in-flow parent when computing touch-action. r=botond
Add a mochitest. r=botond
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.