libreoffice-online/cypress_test/integration_tests/common
Skyler Grey e817f03785 Unify touchscreen handling, remove L.Browser.touch
L.Browser.touch is sometimes nice, but it's ultimately a flawed concept
to use it for input events. Using L.Browser.touch for input handicaps
people with mice if it's too liberal in what it classes as touchscreens,
and handicaps people with touchscreens if it's too conservative. There's
also no sweet spot: it's impossible to choose correctly if someone is
using both a touchscreen and a pointer device, as there's no right
option!

Previously many of our event handlers and some of our UI was gated
behind L.Browser.touch. This commit adds a new "window.touch" property
which is used instead. It has functions to help with event detection,
allowing you to easily make event handlers that work for only the input
devices they are designed for, without gating them behind feature
detection. This has the added bonus that - as you register all the
events - switching between a touchscreen and pointer is now not only
possible but already implemented!

For cases which don't have reasonable events to tag onto (e.g. the
teardrop for cursor movement) this commit adds "hasPrimaryTouchscreen"
and "hasAnyTouchscreen" which use the CSS media queries to detect if
there's a touchscreen attached to your device (either as the primary
input mechanism or at all). This works a lot more similarly to
L.Browser.mode, but being dynamically updated allows you to effectively
swich between touchscreen and not at-will. This still has all of the
disadvantages that L.Browser.touch did when used to register event
handlers, so my advice would be to avoid using it with events.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I9016fc15ad3ccb3664af348fdcdca006495b0778
2023-11-22 15:48:06 +01:00
..
calc_helper.js cypress: autofilter: test autofilter on mobile 2023-09-25 16:41:11 +02:00
contenteditable_helper.js refactored cypress tests for editable area 2023-06-15 15:00:18 -04:00
desktop_helper.js cypress: introduce writer comment autosave tests 2023-10-31 20:43:58 +05:30
helper.js cypress: cypress logs for cool.html iframe 2023-07-10 10:49:04 -04:00
impress_helper.js Enable impress text paragraph props test. 2023-05-10 18:57:53 +03:00
interference_user_spec.js cypress: add option "coolwsd=server:port" 2023-07-10 10:49:04 -04:00
mobile_helper.js Unify touchscreen handling, remove L.Browser.touch 2023-11-22 15:48:06 +01:00
nextcloud_helper.js
repair_document_helper.js Update multi-user tests. 2023-05-05 07:07:14 +03:00
search_helper.js Update calc desktop tests. 2023-05-05 07:07:14 +03:00
writer_helper.js Update cypress tests. 2023-08-14 14:24:46 +03:00