Changeset 126116 in webkit


Ignore:
Timestamp:
Aug 20, 2012 6:50:14 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Cancel the outstanding vibration pattern if the pattern is 0 or an empty list
https://bugs.webkit.org/show_bug.cgi?id=94085

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-08-20
Reviewed by Kentaro Hara.

vibrate() method to stop the device from vibrating is getting called before the
vibration is in effect. Hence, it is failing to cancel the pre-existing instance
of processing vibration patterns.

This patch cancel the pre-existing instance of the processing vibration patterns
always when the vibrate() method called with pattern 0 or an empty list.

No new tests since there is no return value in the Vibration API to test this
particular case. Existing test fast/dom/navigator-vibration.html covers testing of
the Vibration API.

  • Modules/vibration/Vibration.cpp:

(WebCore::Vibration::vibrate):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126113 r126116  
     12012-08-20  Sudarsana Nagineni  <sudarsana.nagineni@linux.intel.com>
     2
     3        Cancel the outstanding vibration pattern if the pattern is 0 or an empty list
     4        https://bugs.webkit.org/show_bug.cgi?id=94085
     5
     6        Reviewed by Kentaro Hara.
     7
     8        vibrate() method to stop the device from vibrating is getting called before the
     9        vibration is in effect. Hence, it is failing to cancel the pre-existing instance
     10        of processing vibration patterns.
     11
     12        This patch cancel the pre-existing instance of the processing vibration patterns
     13        always when the vibrate() method called with pattern 0 or an empty list.
     14
     15        No new tests since there is no return value in the Vibration API to test this
     16        particular case. Existing test fast/dom/navigator-vibration.html covers testing of
     17        the Vibration API.
     18
     19        * Modules/vibration/Vibration.cpp:
     20        (WebCore::Vibration::vibrate):
     21
    1222012-08-20  Adam Klein  <adamk@chromium.org>
    223
  • trunk/Source/WebCore/Modules/vibration/Vibration.cpp

    r125624 r126116  
    5959    int length = pattern.size();
    6060
     61    // Cancel the pre-existing instance of vibration patterns, if the pattern is 0 or an empty list.
     62    if (!length || (length == 1 && !pattern[0])) {
     63        cancelVibration();
     64        return;
     65    }
     66
    6167    if (m_isVibrating)
    6268        cancelVibration();
    63 
    64     if (!length || (length == 1 && !pattern[0]))
    65         return;
    6669
    6770    if (m_timerStart.isActive())
Note: See TracChangeset for help on using the changeset viewer.