RESOLVED FIXED93957
Clear pattern to prevent timing problem between cancelVibration and vibrate
https://bugs.webkit.org/show_bug.cgi?id=93957
Summary Clear pattern to prevent timing problem between cancelVibration and vibrate
Kihong Kwon
Reported 2012-08-14 04:48:58 PDT
If there is javascript codes like below, navigator.vibrate(1000); navigator.vibrate(0); cancelVibrate() can be called before calling vibrate().(It's timer timing issue) In this case, cancelVibrate() is not working at all. We need to fix this.
Attachments
Patch (1.54 KB, patch)
2012-08-14 05:22 PDT, Kihong Kwon
no flags
Kihong Kwon
Comment 1 2012-08-14 05:22:28 PDT
Kihong Kwon
Comment 2 2012-08-14 05:24:42 PDT
CC haraken and morrita.
Kentaro Hara
Comment 3 2012-08-14 05:26:17 PDT
Comment on attachment 158301 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=158301&action=review > Source/WebCore/ChangeLog:11 > + There is a timing issue in the cancelVibration. > + Since vibrate works based on timer, cancelVibration might be called > + eariler than vibrate when cancelVibration is called just after vibrate call. > + It can be prevented from clearing m_pattern in the cancelVibration. Can't you write a layout test for this?
Kihong Kwon
Comment 4 2012-08-14 05:44:45 PDT
(In reply to comment #3) > (From update of attachment 158301 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=158301&action=review > > > Source/WebCore/ChangeLog:11 > > + There is a timing issue in the cancelVibration. > > + Since vibrate works based on timer, cancelVibration might be called > > + eariler than vibrate when cancelVibration is called just after vibrate call. > > + It can be prevented from clearing m_pattern in the cancelVibration. > > Can't you write a layout test for this? There is no return value in the Vibration API. Therefore, if we add layout test, I think we have only way to use printf like legacy notification tests.(LayoutTests/fast/notifications/) But IMHO it's not good to us. I would like to get your opinion about this please. :)
Kentaro Hara
Comment 5 2012-08-14 16:37:06 PDT
Comment on attachment 158301 [details] Patch Thanks, I understood that writing the test is difficult. The change looks reasonable, let's land it.
WebKit Review Bot
Comment 6 2012-08-14 17:10:51 PDT
Comment on attachment 158301 [details] Patch Clearing flags on attachment: 158301 Committed r125624: <http://trac.webkit.org/changeset/125624>
WebKit Review Bot
Comment 7 2012-08-14 17:10:56 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.