Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Issue 137313004: Fix conditional TouchEvent creation support (Closed)

Created:
6 years, 11 months ago by Rick Byers
Modified:
6 years, 11 months ago
Reviewers:
eseidel
CC:
blink-reviews, abarth-chromium, Timothy Loh
Visibility:
Public.

Description

Fix conditional TouchEvent creation support Prior to M2, document.createEvent("TouchEvent") would only succeed when touch support was enabled (eg. we detected a touch screen). Some websites use this as a signal that a touch screen is present. In M32 the location of TouchEvent.idl moved (http://src.chromium.org/viewvc/blink?view=revision&revision=158219) but the old path was still used in EventAliases.idl, and this caused the generated Event.cpp code to have redundant entries making the RuntimeEnabled annotation useless: if (type == "TouchEvent") return TouchEvent::create(); if (type == "TouchEvent" && RuntimeEnabledFeatures::touchEnabled()) return TouchEvent::create(); This change fixes that problem by updating EventAliases.idl with the correct path. This also updates the code generation scripts to flag this sort of mistake an error. Normally an incorrectly typed name in the EventAliases.in file would result in a compile error when we try to include the relevant header file. However the support for 'aliases' requires that when we see a second entry for the same cpp_name (class name) we don't try to include header files for it again (we rely on the fact that we don't need to know the full path in this case). So we just flag an error whenever we see multiple entries with the same script_name. Note that we probably can't just make the entire TouchEvent interface RuntimeEnabled because even when touch support is disabled, chrome dev tools can be used to emulate touch and create instances of TouchEvent objects. Ultimately touch events should really be supported all the time, but that's a larger issue with site compatibility issues. BUG=332588 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165361

Patch Set 1 #

Patch Set 2 : Add build-time validation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -1 line) Patch
M Source/build/scripts/name_macros.py View 1 1 chunk +19 lines, -0 lines 0 comments Download
M Source/core/events/EventAliases.in View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
Rick Byers
Eric, please review this trivial tweak (minor update to your dom->events move back in September). ...
6 years, 11 months ago (2014-01-14 04:49:05 UTC) #1
eseidel
Can you please fix the script to validate that the files at that path exist? ...
6 years, 11 months ago (2014-01-15 20:17:06 UTC) #2
Rick Byers
On 2014/01/15 20:17:06, eseidel wrote: > Can you please fix the script to validate that ...
6 years, 11 months ago (2014-01-15 22:05:11 UTC) #3
Rick Byers
On 2014/01/15 22:05:11, Rick Byers wrote: > On 2014/01/15 20:17:06, eseidel wrote: > > Can ...
6 years, 11 months ago (2014-01-17 21:57:15 UTC) #4
eseidel
lgtm
6 years, 11 months ago (2014-01-17 22:52:35 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rbyers@chromium.org/137313004/70001
6 years, 11 months ago (2014-01-17 22:52:52 UTC) #6
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=23165
6 years, 11 months ago (2014-01-18 02:14:55 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rbyers@chromium.org/137313004/70001
6 years, 11 months ago (2014-01-18 03:23:09 UTC) #8
commit-bot: I haz the power
6 years, 11 months ago (2014-01-18 05:00:27 UTC) #9
Message was sent while issue was closed.
Change committed as 165361

Powered by Google App Engine
This is Rietveld 408576698