RFP: maxTouchPoints on android should be 5
Categories
(Core :: DOM: Events, enhancement)
Tracking
()
People
(Reporter: thorin, Assigned: fkilic)
Details
Attachments
(2 files, 2 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
In FF132+ bug 1826051 we spoofed maxTouchPoints per platform, with android returning 10, but we should actually return 5 as this is what FF is capped at, see https://searchfox.org/mozilla-central/source/toolkit/components/resistfingerprinting/metrics.yaml#75-79
simple patch, would be nice for 139/140 in time for ESR140
| Reporter | ||
Updated•10 months ago
|
| Reporter | ||
Comment 1•10 months ago
|
||
FYI: https://patrickhlauke.github.io/touch/touchlist-objects/ can detect more than 5 simultaneous touch points - piero and I tested. not sure what that means. Chrome also reports 5 maxTouchPoints on my Samsung S24 FE (which I am sure has 10 touch points but I can't find it in any specs)
Whatever we do, we should follow what FF does so we don't raise any red flags
| Assignee | ||
Comment 2•10 months ago
|
||
Do you think it would make sense to use 5 for other platforms too? (basically every platform other than OSX is 10)
| Assignee | ||
Comment 3•10 months ago
|
||
| Assignee | ||
Comment 4•10 months ago
|
||
It looks like firefox only really supports windows and android https://searchfox.org/mozilla-central/search?q=symbol%3A_ZNK12nsBaseWidget17GetMaxTouchPointsEv. So I think the following makes sense
- Windows: 10
- OSX: 0 ( no touch device and support for fetching max touch points )
- Android: 5
- Linux: 0 ( no support for fetching max touch points )
| Assignee | ||
Comment 5•10 months ago
|
||
| Reporter | ||
Comment 6•10 months ago
•
|
||
patch: https://searchfox.org/mozilla-central/source/toolkit/components/resistfingerprinting/nsRFPService.h#49 - isn't this the line we change, for android edit: my bad, there are two patches
(In reply to Fatih Kilic [:fkilic] from comment #2)
Do you think it would make sense to use 5 for other platforms too? (basically every platform other than OSX is 10)
my windows laptop is 10 without the spoof (there's actually a patch we require here to add some touch events, it's a pref value), so we want 10. macs should be 0. android should be 5 which is this issue (I don't see it in the patch - edit: my bad, there are two patches).
I cannot speak for Linux, but we decided on 10 in the original patch in Bug 1826051. IANAE but doesn't this require some command? It too, currently, suffers from missing touch events same as windows.
| Assignee | ||
Comment 7•10 months ago
|
||
IANAE but doesn't this require some command
Yeah we need to somehow fetch max touch points supported. The weird thing is, on linux, we detect touch screen support, but not the max touch points, so it always returns 0 on linux. So maybe we should spoof it to zero on linux too.
| Reporter | ||
Comment 8•10 months ago
|
||
command
MOZ_USE_XINPUT2=1 ?? (IANAE). If Linux always reports 0 for Firefox then we should match
there's actually a patch we require here to add some touch
eventsproperties, it's a pref value
dom.w3c_touch_events.enabled// 0=disabled (macOS) 1=enabled 2=autodetect (linux/win/android)- on desktop, when enabled (
1) this adds the touch properties [1], same as my laptop on autodetect2) - the pref does not require a restart, so can be applied as a target (IIUIC)
[1] "window" properties: ["Touch", "TouchEvent", "TouchList"]
- android
5(pref is fine) - windows
10and treatdom.w3c_touch_events.enabled=1 - linux
0and treatdom.w3c_touch_events.enabled=0// block users with that command thingie IUIIC? - mac
0(pref is fine)
We can spin off the window touch properties in another issue, i.e ignore the pref value and hardcode it
Comment 9•10 months ago
|
||
Linux/GTK
(In reply to Thorin [:thorin] from comment #8)
MOZ_USE_XINPUT2=1?? (IANAE). If Linux always reports0for Firefox then we should match
Actually yes, XInput 2 supports number of touches (num_touches in TouchClass).
However, Firefox doesn't interact with the API directly, it let GDK handle it.
Also, according to the comment, Wayland should always have touch support, without explicitly enabling XInput 2 (to be verified!).
So, on GDK this property is available only as device-specific, as far as I can tell.
This makes sense, since the touch property is inherently a device thing (and it's the same with the underlying API).
FWIW, in non-RFP we could go through all of them and return the maximum.
From the standard:
For example, suppose a device has 3 touchscreens, which support 2, 5, and 10 simultaneous touch contacts, respectively. The value of
maxTouchPointsshould be 10.
It's a bit sad that GDK doesn't provide this value for us.
Windows
As found by Fatih, on Windows, it's a system property computed in some Windowsy way.
I wonder if it's the same way as the spec (maximum of the connected devices).
Android
Android is the most interesting one, as it's the one where touch it the most useful, and yet the less precise!
We don't get a hardware value, but we check system features, which are broad device classes:
- full-hand, i.e., at least 5 points, we return 5
- multi-touch (basic or distinct), i.e., two points (basic) or more (distinct), we return 1
- touch screen, i.e., single point
According to this very old (2011) StackOverflow answer, this is the way to do it, unless you start checking the touch events.
However, this is allowed by the standard:
On platforms where the precise number of touch points is not known, the minimum number guaranteed to be recognized is provided. Therefore, it is possible for the number of recognized touch points to exceed the value of
maxTouchPoints.
Thorin: this might explain why I could track 10 fingers, but nothing more (I know my device supports 2 hands, and I think it's kinda standard).
| Assignee | ||
Comment 10•6 months ago
|
||
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 11•6 months ago
|
||
Comment 12•6 months ago
|
||
| bugherder | ||
Comment 13•6 months ago
|
||
Hi! Thanks for the patch!
Could this be uplifted to esr140, especially since it affects also Linux?
Comment 14•6 months ago
|
||
[Tracking Requested - why for this release]: It would help Tor maintain fewer patches on their fork. It does not affect normal Firefox users, only those with RFP enabled.
Updated•6 months ago
|
Comment 15•6 months ago
|
||
Please nominate this for ESR140 uplift when you get a chance.
| Assignee | ||
Comment 16•6 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D259044
Updated•6 months ago
|
Comment 17•6 months ago
|
||
firefox-esr140 Uplift Approval Request
- User impact if declined: Nothing. Tor will have more patches to carry
- Code covered by automated testing: no
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: Enable privacy.resistFingerprinting, check and verify navigator.maxTouchPoints == 5
- Risk associated with taking this patch: None
- Explanation of risk level: N/A
- String changes made/needed: No
- Is Android affected?: yes
Updated•6 months ago
|
Updated•6 months ago
|
Comment 19•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Description
•