Bug 51196

Summary: Support createTouchList with Touch list
Product: WebKit Reporter: Chang Shu <cshu>
Component: DOMAssignee: Chang Shu <cshu>
Status: RESOLVED FIXED    
Severity: Normal CC: ademar, commit-queue, dglazkov, eric, gmak, hausmann, kenneth, manyoso, suresh.voruganti, tonikitoo, webkit.review.bot, yaar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on: 52069    
Bug Blocks:    
Attachments:
Description Flags
fix patch
none
fix patch 2
kenneth: review-
fix patch 3
none
fix patch 4 none

Chang Shu
Reported 2010-12-16 10:18:10 PST
The current API and implementation of createTouchList can only create a TouchList object with no list of Touch objects attached. Hence, it has to be enhanced for testing purpose.
Attachments
fix patch (7.73 KB, patch)
2010-12-16 11:15 PST, Chang Shu
no flags
fix patch 2 (8.85 KB, patch)
2010-12-22 12:42 PST, Chang Shu
kenneth: review-
fix patch 3 (9.46 KB, patch)
2011-01-03 14:22 PST, Chang Shu
no flags
fix patch 4 (7.13 KB, patch)
2011-01-07 12:16 PST, Chang Shu
no flags
Chang Shu
Comment 1 2010-12-16 11:15:20 PST
Created attachment 76791 [details] fix patch
WebKit Review Bot
Comment 2 2010-12-16 11:17:46 PST
Attachment 76791 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast/events/touch/document-create-touch-list-expected.txt', u'LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js', u'WebCore/ChangeLog', u'WebCore/bindings/js/JSDocumentCustom.cpp', u'WebCore/bindings/scripts/CodeGeneratorJS.pm', u'WebCore/dom/Document.idl', u'WebCore/dom/TouchEvent.cpp']" exit_code: 1 WebCore/bindings/js/JSDocumentCustom.cpp:137: One line control clauses should not use braces. [whitespace/braces] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Review Bot
Comment 3 2010-12-16 11:23:14 PST
WebKit Review Bot
Comment 4 2010-12-16 12:00:06 PST
Chang Shu
Comment 5 2010-12-22 12:42:02 PST
Created attachment 77251 [details] fix patch 2
Kenneth Rohde Christiansen
Comment 6 2010-12-24 02:52:59 PST
Comment on attachment 77251 [details] fix patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=77251&action=review It this a useful feature? Does other platforms support it? Why is it needed. R- due to not detailing this. > WebCore/ChangeLog:9 > + 1. Added support of ArgList as an argument for a Custom function. > + 2. Implemented JS/V8 bindings for createTouchList. You should detail why this is needed at all.
anton muhin
Comment 7 2010-12-24 05:17:39 PST
Comment on attachment 77251 [details] fix patch 2 View in context: https://bugs.webkit.org/attachment.cgi?id=77251&action=review > WebCore/bindings/v8/custom/V8DocumentCustom.cpp:175 > + touchList->append(V8Touch::toNative(args[i]->ToObject())); chances are ToObject can throw, is it fine? May we cover this case in LayoutTests?
Chang Shu
Comment 8 2011-01-03 08:26:58 PST
(In reply to comment #6) > (From update of attachment 77251 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=77251&action=review > > It this a useful feature? Does other platforms support it? Why is it needed. R- due to not detailing this. > > > WebCore/ChangeLog:9 > > + 1. Added support of ArgList as an argument for a Custom function. > > + 2. Implemented JS/V8 bindings for createTouchList. > > You should detail why this is needed at all. Thanks, Kenneth. This feature is useful for testing purpose. I have seen it implemented in iOS. The bug was originally reported from this link: https://projects.maemo.org/bugzilla/show_bug.cgi?id=193143.
Chang Shu
Comment 9 2011-01-03 14:22:12 PST
Created attachment 77847 [details] fix patch 3 Based on Kenneth and Anton's comments: 1. added purpose for this new feature. 2. added code to handle invalid arguments for V8.
Chang Shu
Comment 10 2011-01-03 14:23:24 PST
(In reply to comment #7) > (From update of attachment 77251 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=77251&action=review > > > WebCore/bindings/v8/custom/V8DocumentCustom.cpp:175 > > + touchList->append(V8Touch::toNative(args[i]->ToObject())); > > chances are ToObject can throw, is it fine? May we cover this case in LayoutTests? good catch! I have added code and test case for this. thanks!
Simon Hausmann
Comment 11 2011-01-05 06:30:20 PST
Hmm, I see that would make us incompatible with Apple's implementation. See http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html - createTouchList() doesn't take an argument...
Chang Shu
Comment 12 2011-01-05 06:49:28 PST
(In reply to comment #11) > Hmm, I see that would make us incompatible with Apple's implementation. See http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html - createTouchList() doesn't take an argument... From the iOS source code and test on iphone, createTouchList() with arguments is supported. Maybe the documentation is out-of-date?
Kenneth Rohde Christiansen
Comment 13 2011-01-05 12:05:32 PST
Comment on attachment 77847 [details] fix patch 3 View in context: https://bugs.webkit.org/attachment.cgi?id=77847&action=review > WebCore/bindings/scripts/CodeGeneratorJS.pm:863 > - push(@headerContent, " JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*);\n"); > + my $parameter = @{$function->parameters}[0]; > + if ($parameter && $codeGenerator->StripModule($parameter->type) =~ /argList/) { > + push(@headerContent, " JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*, const JSC::ArgList&);\n"); > + } else { > + push(@headerContent, " JSC::JSValue " . $functionImplementationName . "(JSC::ExecState*);\n"); > + } You need to add tests then modifying the generator.
Chang Shu
Comment 14 2011-01-06 08:34:00 PST
Can you show me more details? My patch includes tests. > > You need to add tests then modifying the generator.
Kenneth Rohde Christiansen
Comment 15 2011-01-06 11:08:26 PST
It includes tests for the feature, not for the generator. You modified the generator and so you need to expand the test of the generator to cover your changes. Look in bindings/scripts/test I have never done any of these tests myself, but I have seen it requested whenever the generator was changed.
Chang Shu
Comment 16 2011-01-07 12:16:09 PST
Created attachment 78256 [details] fix patch 4 It turns out that the changes in CodeGeneratorJS.pm are not needed. Thanks, Sam, for pointing out this.
Kenneth Rohde Christiansen
Comment 17 2011-01-07 12:21:30 PST
Comment on attachment 78256 [details] fix patch 4 LGTM
Chang Shu
Comment 18 2011-01-07 12:25:20 PST
Comment on attachment 78256 [details] fix patch 4 thanks for the quick review. :)
WebKit Commit Bot
Comment 19 2011-01-08 17:08:56 PST
Comment on attachment 78256 [details] fix patch 4 Clearing flags on attachment: 78256 Committed r75335: <http://trac.webkit.org/changeset/75335>
WebKit Commit Bot
Comment 20 2011-01-08 17:09:04 PST
All reviewed patches have been landed. Closing bug.
Suresh Voruganti
Comment 21 2011-01-10 06:27:32 PST
Please cherry pick fix to Qtwebkit 2.2
Ademar Reis
Comment 22 2011-01-10 12:41:05 PST
(In reply to comment #21) > Please cherry pick fix to Qtwebkit 2.2 We'll need a backport for this: besides the fact that the files have been moved on trunk, the code also appears to be quite different.
Suresh Voruganti
Comment 23 2011-01-10 13:37:29 PST
Chang, can you work on backported version?
Note You need to log in before you can comment on or make changes to this bug.