Bug 84397 - Web Inspector: Enable touch events feature fails touch feature detection
Summary: Web Inspector: Enable touch events feature fails touch feature detection
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
Depends on:
Reported: 2012-04-19 16:09 PDT by Paul Irish
Modified: 2012-04-28 07:19 PDT (History)
11 users (show)

See Also:

Patch (6.03 KB, patch)
2012-04-28 06:23 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Irish 2012-04-19 16:09:45 PDT
Handling both desktop and touch devices, js app code will often fork the libraries loaded in and behavior wired up depending on if touch events are detected.

The most common detect for this is: 'ontouchstart' in window

The Emulate Touch Events feature in the Inspector will create touch events, but any code relying on a feature detect will fork in the wrong path. 

Could the feature also expose touch events like the above in the DOM so the page can fork behavior correctly?
Comment 1 Alexander Pavlov (apavlov) 2012-04-28 06:23:24 PDT
Created attachment 139359 [details]
Comment 2 Pavel Feldman 2012-04-28 07:13:31 PDT
Comment on attachment 139359 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=139359&action=review

> Source/WebCore/inspector/front-end/DOMAgent.js:1185
> +        const functionText =

you should declare a function a call toString on it.
Comment 3 Alexander Pavlov (apavlov) 2012-04-28 07:19:52 PDT
Committed r115569: <http://trac.webkit.org/changeset/115569>