Bug 32114

Summary: Multitouch DOM event
Product: WebKit Reporter: Jonni Rainisto <jonni.rainisto>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, benm, bolsinga, commit-queue, darin, ddkilzer, hausmann, hyatt, jonni.rainisto, kenneth, laszlo.gombos, mrowe, pknight, simon.fraser, tonikitoo, vestbo, webkit.review.bot, xhiloh, yael
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 32485    
Attachments:
Description Flags
Platform touch event
none
touch12-touch-dom-event
none
touch13-qtimplementation
none
touch12-touch-dom-event
none
Added interfaces for touch event support in JavaScript.
none
https://bugs.webkit.org/show_bug.cgi?id=32114
none
https://bugs.webkit.org/show_bug.cgi?id=32114
koivisto: review+
Patch none

Description Jonni Rainisto 2009-12-03 04:04:01 PST
Created attachment 44226 [details]
Platform touch event

Platform independent touch events with refence implementation to Qt4.6 backend. Documentation to IDL file can be found here http://www.starlight-webkit.org/documentation/multitouch

Working pre-compiled binaries for testing the multitouch dom events with supported Windows 7 hardware can be found here: http://www.opensource.nokia.com/Starlight

Layout test, manipulate and gesture engine patches will be added soon to this bug or followup bug report.

Patches have been divided in smaller chunks, so they can be reviewed better. Patches need to be applied in right order, 1 + 12 + 13.
Comment 1 Jonni Rainisto 2009-12-03 04:05:18 PST
Created attachment 44227 [details]
touch12-touch-dom-event
Comment 2 Jonni Rainisto 2009-12-03 04:06:37 PST
Created attachment 44228 [details]
touch13-qtimplementation
Comment 3 WebKit Review Bot 2009-12-03 04:08:32 PST
style-queue ran check-webkit-style on attachment 44226 [details] without any errors.
Comment 4 WebKit Review Bot 2009-12-03 04:08:51 PST
style-queue ran check-webkit-style on attachment 44228 [details] without any errors.
Comment 5 WebKit Review Bot 2009-12-03 04:09:10 PST
style-queue ran check-webkit-style on attachment 44227 [details] without any errors.
Comment 6 Kenneth Rohde Christiansen 2009-12-03 04:49:12 PST
Comment on attachment 44226 [details]
Platform touch event


> +    bool areStates(PlatformTouchState state) const

I found this method a bit strange. areStates? I guess it is meant for knowing whether all points are in the same state?

What about something more descriptive like allTouchPointsAreInState() or allHasState()?

> +    bool hasState(PlatformTouchState state) const

someHasState()?

Maybe combine the two methods and use an enum to separate them?

> +    PlatformTouchMoved,
> +    PlatformTouchStationary

Stationary means that it didn't change ? or ?


> +    float pressure() const;

is this in percentage?

> +    IntRect rect() const;

is this the boundingRect?
Comment 7 Kenneth Rohde Christiansen 2009-12-03 04:53:22 PST
Comment on attachment 44228 [details]
touch13-qtimplementation


> +#if PLATFORM(QT)
> +    // Qt implementation of touch point
> +    QTouchEvent::TouchPoint m_touchPoint;
> +#endif

That is a kind of useless comment :-)

Btw, you miss an implementation for QGraphicsWebView it seems.
Comment 8 Jonni Rainisto 2009-12-03 05:50:20 PST
Created attachment 44234 [details]
touch12-touch-dom-event

fix to original patch which was missing some files.
Comment 9 WebKit Review Bot 2009-12-03 05:52:26 PST
style-queue ran check-webkit-style on attachment 44234 [details] without any errors.
Comment 10 Simon Hausmann 2009-12-03 07:25:38 PST
From what I can see, there are three versions of WebKit out there on devices today that support handling touch events with Javascript: The version of WebKit that comes with the iPhone, the version that comes with Android (2.0/eclair in particular) and the version that Palm ships in WebOS.

As far as I can see they are basically compatible with each other, but neither implementation is upstream here on webkit.org.

However there is web content out there today that relies on these interfaces, and given the popularity of these platforms I'm inclined to say that these interfaces have become a de-facto standard.

I believe touch interfaces for inclusion in webkit.org should be compatible (identical?) to this "standard".
Comment 11 Simon Hausmann 2009-12-03 07:27:11 PST
A slightly more Qt implementation specific comment: The touch event interface in Qt (QTouchEvent) is based on the concept that one event provides information of all the touch points.

It appears that the aforementioned existing JS interface for touch interaction use the same model, therefore making the mapping from QTouchEvent to the JS interface a really simple translation of data structures.
Comment 12 Simon Hausmann 2009-12-09 14:55:18 PST
Created attachment 44570 [details]
Added interfaces for touch event support in JavaScript.
Comment 15 WebKit Review Bot 2009-12-09 14:59:10 PST
style-queue ran check-webkit-style on attachment 44570 [details] without any errors.
Comment 16 Antti Koivisto 2009-12-11 02:25:16 PST
Comment on attachment 44570 [details]
Added interfaces for touch event support in JavaScript.

Looks good, r=me
Comment 17 Simon Hausmann 2009-12-11 04:58:10 PST
Created attachment 44676 [details]
Patch
Comment 18 Simon Hausmann 2009-12-11 04:58:51 PST
Comment on attachment 44572 [details]
https://bugs.webkit.org/show_bug.cgi?id=32114

Obsoleted by new patch that has a merge conflict with the mac/Skipped file fixed
Comment 19 WebKit Review Bot 2009-12-11 05:01:04 PST
style-queue ran check-webkit-style on attachment 44676 [details] without any errors.
Comment 20 WebKit Commit Bot 2009-12-11 06:08:05 PST
Comment on attachment 44570 [details]
Added interfaces for touch event support in JavaScript.

Clearing flags on attachment: 44570

Committed r51981: <http://trac.webkit.org/changeset/51981>
Comment 21 WebKit Commit Bot 2009-12-11 06:15:53 PST
Comment on attachment 44676 [details]
Patch

Clearing flags on attachment: 44676

Committed r51982: <http://trac.webkit.org/changeset/51982>
Comment 22 WebKit Commit Bot 2009-12-11 06:16:04 PST
All reviewed patches have been landed.  Closing bug.