Changeset 145481 in webkit


Ignore:
Timestamp:
Mar 11, 2013 10:45:19 PM (11 years ago)
Author:
jochen@chromium.org
Message:

Don't create multiple user gesture indicators when forwarding events to sub frames
https://bugs.webkit.org/show_bug.cgi?id=111923

Reviewed by Adam Barth.

Ports that implement consumable user gestures depend on a single user
gesture indicator being created in response to a single user gesture.

Source/WebCore:

Test: platform/chromium/fast/events/popup-allowed-from-gesture-only-once-iframes.html

  • dom/UserGestureIndicator.cpp:

(WebCore::isDefinite):
(WebCore::UserGestureIndicator::UserGestureIndicator):
(WebCore::UserGestureIndicator::processingUserGesture):

  • dom/UserGestureIndicator.h:
  • page/EventHandler.cpp:

(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::keyEvent):
(WebCore::EventHandler::handleTouchEvent):

LayoutTests:

  • platform/chromium/fast/events/popup-allowed-from-gesture-only-once-iframes-expected.txt: Added.
  • platform/chromium/fast/events/popup-allowed-from-gesture-only-once-iframes.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145479 r145481  
     12013-03-11  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Don't create multiple user gesture indicators when forwarding events to sub frames
     4        https://bugs.webkit.org/show_bug.cgi?id=111923
     5
     6        Reviewed by Adam Barth.
     7
     8        Ports that implement consumable user gestures depend on a single user
     9        gesture indicator being created in response to a single user gesture.
     10
     11        * platform/chromium/fast/events/popup-allowed-from-gesture-only-once-iframes-expected.txt: Added.
     12        * platform/chromium/fast/events/popup-allowed-from-gesture-only-once-iframes.html: Added.
     13
    1142013-03-11  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r145480 r145481  
     12013-03-11  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Don't create multiple user gesture indicators when forwarding events to sub frames
     4        https://bugs.webkit.org/show_bug.cgi?id=111923
     5
     6        Reviewed by Adam Barth.
     7
     8        Ports that implement consumable user gestures depend on a single user
     9        gesture indicator being created in response to a single user gesture.
     10
     11        Test: platform/chromium/fast/events/popup-allowed-from-gesture-only-once-iframes.html
     12
     13        * dom/UserGestureIndicator.cpp:
     14        (WebCore::isDefinite):
     15        (WebCore::UserGestureIndicator::UserGestureIndicator):
     16        (WebCore::UserGestureIndicator::processingUserGesture):
     17        * dom/UserGestureIndicator.h:
     18        * page/EventHandler.cpp:
     19        (WebCore::EventHandler::handleMousePressEvent):
     20        (WebCore::EventHandler::handleMouseDoubleClickEvent):
     21        (WebCore::EventHandler::handleMouseReleaseEvent):
     22        (WebCore::EventHandler::keyEvent):
     23        (WebCore::EventHandler::handleTouchEvent):
     24
    1252013-03-11  Simon Fraser  <simon.fraser@apple.com>
    226
  • trunk/Source/WebCore/dom/UserGestureIndicator.cpp

    r145453 r145481  
    6060static bool isDefinite(ProcessingUserGestureState state)
    6161{
    62     return state == DefinitelyProcessingNewUserGesture || state == DefinitelyNotProcessingUserGesture;
     62    return state == DefinitelyProcessingNewUserGesture || state == DefinitelyProcessingUserGesture || state == DefinitelyNotProcessingUserGesture;
    6363}
    6464
     
    8181    if (state == DefinitelyProcessingNewUserGesture)
    8282        static_cast<GestureToken*>(m_token.get())->addGesture();
     83    else if (state == DefinitelyProcessingUserGesture && s_topmostIndicator == this)
     84        static_cast<GestureToken*>(m_token.get())->addGesture();
    8385    ASSERT(isDefinite(s_state));
    8486}
     
    9698            static_cast<GestureToken*>(token.get())->consumeGesture();
    9799        }
    98         s_state = DefinitelyProcessingNewUserGesture;
     100        s_state = DefinitelyProcessingUserGesture;
    99101    }
    100102
     
    112114bool UserGestureIndicator::processingUserGesture()
    113115{
    114     return s_topmostIndicator && static_cast<GestureToken*>(s_topmostIndicator->currentToken())->hasGestures() && s_state == DefinitelyProcessingNewUserGesture;
     116    return s_topmostIndicator && static_cast<GestureToken*>(s_topmostIndicator->currentToken())->hasGestures() && (s_state == DefinitelyProcessingNewUserGesture || s_state == DefinitelyProcessingUserGesture);
    115117}
    116118
  • trunk/Source/WebCore/dom/UserGestureIndicator.h

    r145453 r145481  
    3535enum ProcessingUserGestureState {
    3636    DefinitelyProcessingNewUserGesture,
     37    DefinitelyProcessingUserGesture,
    3738    PossiblyProcessingUserGesture,
    3839    DefinitelyNotProcessingUserGesture
  • trunk/Source/WebCore/page/EventHandler.cpp

    r145453 r145481  
    14551455#endif
    14561456
    1457     UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
     1457    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
    14581458    m_lastMouseDownUserGestureToken = gestureIndicator.currentToken();
    14591459
     
    15891589    m_frame->selection()->setCaretBlinkingSuspended(false);
    15901590
    1591     UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
     1591    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
    15921592
    15931593    // We get this instead of a second mouse-up
     
    18321832        gestureIndicator = adoptPtr(new UserGestureIndicator(m_lastMouseDownUserGestureToken.release()));
    18331833    else
    1834         gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
     1834        gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessingUserGesture));
    18351835
    18361836#if ENABLE(PAN_SCROLLING)
     
    31573157        return false;
    31583158
    3159     UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
     3159    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
    31603160    UserTypingGestureIndicator typingGestureIndicator(m_frame);
    31613161
     
    38543854    const Vector<PlatformTouchPoint>& points = event.touchPoints();
    38553855
    3856     UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
     3856    UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
    38573857
    38583858    unsigned i;
Note: See TracChangeset for help on using the changeset viewer.