Changeset 128273 in webkit


Ignore:
Timestamp:
Sep 12, 2012 12:53:59 AM (12 years ago)
Author:
jochen@chromium.org
Message:

Source/WebKit/chromium: [chromium] consumable user gesture count off for input events
https://bugs.webkit.org/show_bug.cgi?id=96373

Reviewed by Adam Barth.

Don't create a UserGestureIndicator in the chromium layer, as it will
already be created by webcore's event handler. Creating multiple
UserGestureIndicator objects for the same object would allow to execute
multiple user-gesture-gated actions per user gesture such as opening a
new window.

  • public/WebInputEvent.h:
  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::handleInputEvent):

Tools: [chromium] Consume a user gesture when creating a new view.
https://bugs.webkit.org/show_bug.cgi?id=96373

Reviewed by Adam Barth.

  • DumpRenderTree/chromium/WebViewHost.cpp:

(WebViewHost::createView):

LayoutTests: [chromium] Only allow one user-gesture gated action per user action.
https://bugs.webkit.org/show_bug.cgi?id=96373

Reviewed by Adam Barth.

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128270 r128273  
     12012-09-12  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] Only allow one user-gesture gated action per user action.
     4        https://bugs.webkit.org/show_bug.cgi?id=96373
     5
     6        Reviewed by Adam Barth.
     7
     8        * platform/chromium/fast/events/popup-allowed-from-gesture-only-once-expected.txt: Added.
     9        * platform/chromium/fast/events/popup-allowed-from-gesture-only-once.html: Added.
     10
    1112012-09-12  Jochen Eisinger  <jochen@chromium.org>
    212
  • trunk/Source/WebKit/chromium/ChangeLog

    r128269 r128273  
     12012-09-12  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] consumable user gesture count off for input events
     4        https://bugs.webkit.org/show_bug.cgi?id=96373
     5
     6        Reviewed by Adam Barth.
     7
     8        Don't create a UserGestureIndicator in the chromium layer, as it will
     9        already be created by webcore's event handler. Creating multiple
     10        UserGestureIndicator objects for the same object would allow to execute
     11        multiple user-gesture-gated actions per user gesture such as opening a
     12        new window.
     13
     14        * public/WebInputEvent.h:
     15        * src/WebViewImpl.cpp:
     16        (WebKit::WebViewImpl::handleInputEvent):
     17
    1182012-09-12  Alexandre Elias  <aelias@chromium.org>
    219
  • trunk/Source/WebKit/chromium/public/WebInputEvent.h

    r128093 r128273  
    195195    }
    196196
    197     // Returns true if the WebInputEvent |type| should be handled as user gesture.
    198     static bool isUserGestureEventType(int type)
    199     {
    200         return isKeyboardEventType(type)
    201             || type == MouseDown
    202             || type == MouseUp
    203             || type == TouchStart
    204             || type == TouchEnd;
    205     }
    206 
    207197    // Returns true if the WebInputEvent is a gesture event.
    208198    static bool isGestureEventType(int type)
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r128269 r128273  
    121121#include "Timer.h"
    122122#include "TraceEvent.h"
    123 #include "UserGestureIndicator.h"
    124123#include "WebAccessibilityObject.h"
    125124#include "WebActiveWheelFlingParameters.h"
     
    19071906bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
    19081907{
    1909     UserGestureIndicator gestureIndicator(WebInputEvent::isUserGestureEventType(inputEvent.type) ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
    1910 
    19111908    // If we've started a drag and drop operation, ignore input events until
    19121909    // we're done.
  • trunk/Tools/ChangeLog

    r128272 r128273  
     12012-09-12  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] Consume a user gesture when creating a new view.
     4        https://bugs.webkit.org/show_bug.cgi?id=96373
     5
     6        Reviewed by Adam Barth.
     7
     8        * DumpRenderTree/chromium/WebViewHost.cpp:
     9        (WebViewHost::createView):
     10
    1112012-09-12  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    212
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r127473 r128273  
    252252// WebViewClient -------------------------------------------------------------
    253253
    254 WebView* WebViewHost::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy)
     254WebView* WebViewHost::createView(WebFrame* creator, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy)
    255255{
    256256    if (!testRunner()->canOpenWindows())
     
    258258    if (testRunner()->shouldDumpCreateView())
    259259        fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str());
     260    creator->consumeUserGesture();
    260261    return m_shell->createNewWindow(WebURL())->webView();
    261262}
Note: See TracChangeset for help on using the changeset viewer.