• jochen@chromium.org's avatar
    Make sure that user gestures can't be consumed twice · ca1aea26
    jochen@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=97483
    
    Reviewed by Adam Barth.
    
    Source/WebCore:
    
    Instead of a simple counter, use a ref counted token to track how many
    user gestures happened and where consumed. When creating a timer that
    is supposed to forward the user gesture, take a reference to this token
    and reinstantiate the UserGestureIndicator with that token when the
    timer is triggered.
    
    Tests: platform/chromium/fast/events/popup-forwarded-gesture-blocked.html
           platform/chromium/fast/events/popup-forwarded-gesture.html
    
    * dom/UserGestureIndicator.cpp:
    (WebCore):
    (WebCore::UserGestureIndicator::UserGestureIndicator):
    (WebCore::UserGestureIndicator::~UserGestureIndicator):
    (WebCore::UserGestureIndicator::processingUserGesture):
    (WebCore::UserGestureIndicator::consumeUserGesture):
    (WebCore::UserGestureIndicator::currentToken):
    * dom/UserGestureIndicator.h:
    (Token):
    (WebCore::UserGestureIndicator::Token::~Token):
    (UserGestureIndicator):
    * page/DOMTimer.cpp:
    (WebCore::DOMTimer::DOMTimer):
    (WebCore::DOMTimer::fired):
    * page/DOMTimer.h:
    (DOMTimer):
    
    LayoutTests:
    
    * platform/chromium/fast/events/popup-forwarded-gesture-blocked-expected.txt: Added.
    * platform/chromium/fast/events/popup-forwarded-gesture-blocked.html: Added.
    * platform/chromium/fast/events/popup-forwarded-gesture-expected.txt: Added.
    * platform/chromium/fast/events/popup-forwarded-gesture.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ca1aea26
DOMTimer.h 3.19 KB