Pointer Events Now in Firefox Nightly
hacks.mozilla.org
hacks.mozilla.org
"The page at xxxxx would like to track the movements of your mouse pointer. Do you wish to allow this action?"
I wonder how many pages are doing this already without their users noticing...
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ You have moved the mouse pointer ┃
┃ ┃
┃ Windows will have to restart to ┃
┃ apply this change ┃
┃ ┃
┃ [OK] ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛All it does is add a third case that every application needs to support from here on out. You need to do your sniffing, then register mouse events or touch events or pointer events as necessary. And write similar but different code paths for each case. And you need to maintain and test all three of those branches for ever.
It's that XKCD comic. And that Joel blog post from fifteen years ago. Implemented with no irony whatsoever by people who seem not to have read either.
IMHO, the most important changes are pen support and the "touch-action" CSS property[1].
There have been many attempts to make native-looking HTML5 apps in phones and tablets. Do you know why none feel native? Scrolling. When you scroll, pan, zoom... JS events must fire and many things must happen before redrawing the screen. That's avoided with the "touch-action" property. There are other reasons but this has been the most important one.
[1] I would have preferred a HTML attribute, but things like "pointer-events" already exist.
That's not how polyfills work.
[0] It's not capitalised
[1] Spolsky, I assume.
It's a completely different scenario than when I did web dev in 2008. Also, Joel article is not fifteen years old, it's nine.
There's also IE, Firefox and "am I running from the local filesystem" checks in there. All necessary to work around real differences in implementation in the most current crop of "modern" browsers.
It's a rare feature that I can ship that works out of the box in every browser. But, as it was 20 years ago, this is the job we signed up for. I just wish people stopped going out of their way to add more unnecessary things that I need to special case around.
[0] https://groups.google.com/a/chromium.org/forum/#!topic/blink...
Mouse interaction and touch interaction are as different as mouse interaction and keyboard interaction. They really do need to be treated completely differently, with different user experience models and code paths.
You really shouldn't be assuming you know anything about the interface and only use pointer events in the most minimal, generic way possible. To that end, this new "pointer event" may be useful. If you want better, more detailed pointer information, you should use a platform that provides it such as writing a native app.
/* the same goes for reimplementing widgets like scrollbars: don't, that's the job of the User Agent */
If you design for a generic model, you're going to end up with a crappy interface.
My understanding is that this is in addition to the existing mouse & touch APIs, so developers can just use whatever makes sense for their application.