Bug 106071 - Existence of window.Touch can break websites mobile device detection
Summary: Existence of window.Touch can break websites mobile device detection
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rick Byers
Keywords: WebExposed
Depends on:
Blocks: 96295
  Show dependency treegraph
Reported: 2013-01-03 18:24 PST by Rick Byers
Modified: 2013-01-04 11:55 PST (History)
7 users (show)

See Also:

Patch (7.55 KB, patch)
2013-01-03 18:32 PST, Rick Byers
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Byers 2013-01-03 18:24:23 PST
In bug 96295, I added window.Touch and window.TouchList constructors when built with TOUCH_EVENTS.  At least one web app uses the existance of window.Touch to infer that they're on a mobile default (and so shouldn't listen to mouse events).  This is completely broken and we need to get such sites fixed, but our strategy should be the same as for more common (but equally wrong) check sites do like looking for window.ontouchstart (which, for now, we enable dynamically at runtime - eg. based on whether or not a touch screen is actually present)

For now (Chrome M25) I'm going to revert my change.  I'll file a separate bug to put these back but controlled dynamically.
Comment 1 Rick Byers 2013-01-03 18:32:01 PST
Created attachment 181258 [details]
Comment 2 Rick Byers 2013-01-03 18:34:31 PST
Will track re-landing this in the original bug: bug 96295
Comment 3 WebKit Review Bot 2013-01-04 09:59:29 PST
Comment on attachment 181258 [details]

Clearing flags on attachment: 181258

Committed r138808: <http://trac.webkit.org/changeset/138808>
Comment 4 WebKit Review Bot 2013-01-04 09:59:34 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Rick Byers 2013-01-04 10:27:35 PST
Thanks Ojan!