Changeset 136899 in webkit


Ignore:
Timestamp:
Dec 6, 2012, 3:20:12 PM (12 years ago)
Author:
jochen@chromium.org
Message:

[chromium] when forwarding events through the WebPluginContainer, create a UserGestureIndicator if processing a user gesture
https://bugs.webkit.org/show_bug.cgi?id=104306

Reviewed by Dimitri Glazkov.

Source/WebKit/chromium:

In http://trac.webkit.org/changeset/65964 a UserGestureIndicator was
introduced in chromium's WebKit layer intended to fix a problem with
plugins, however, it also affected regular event handling, so I removed
it in http://trac.webkit.org/changeset/128273. Turns out it still is a
problem for plugins. This change adds the UserGestureIndicator back,
however, only for the WebPluginContainer.

  • public/WebInputEvent.h:

(WebInputEvent):
(WebKit::WebInputEvent::isUserGestureEventType):

  • src/WebPluginContainerImpl.cpp:

(WebKit::WebPluginContainerImpl::handleEvent):

Tools:

  • DumpRenderTree/chromium/TestWebPlugin.cpp:

(TestWebPlugin::TestWebPlugin):
(TestWebPlugin::handleInputEvent): add support for printing the user gesture status

  • DumpRenderTree/chromium/TestWebPlugin.h:

(TestWebPlugin):

LayoutTests:

  • platform/chromium/plugins/user-gesture-expected.txt: Added.
  • platform/chromium/plugins/user-gesture.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r136894 r136899  
     12012-12-06  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] when forwarding events through the WebPluginContainer, create a UserGestureIndicator if processing a user gesture
     4        https://bugs.webkit.org/show_bug.cgi?id=104306
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * platform/chromium/plugins/user-gesture-expected.txt: Added.
     9        * platform/chromium/plugins/user-gesture.html: Added.
     10
    1112012-12-06  David Grogan  <dgrogan@chromium.org>
    212
  • trunk/Source/WebKit/chromium/ChangeLog

    r136897 r136899  
     12012-12-06  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] when forwarding events through the WebPluginContainer, create a UserGestureIndicator if processing a user gesture
     4        https://bugs.webkit.org/show_bug.cgi?id=104306
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        In http://trac.webkit.org/changeset/65964 a UserGestureIndicator was
     9        introduced in chromium's WebKit layer intended to fix a problem with
     10        plugins, however, it also affected regular event handling, so I removed
     11        it in http://trac.webkit.org/changeset/128273. Turns out it still is a
     12        problem for plugins. This change adds the UserGestureIndicator back,
     13        however, only for the WebPluginContainer.
     14
     15        * public/WebInputEvent.h:
     16        (WebInputEvent):
     17        (WebKit::WebInputEvent::isUserGestureEventType):
     18        * src/WebPluginContainerImpl.cpp:
     19        (WebKit::WebPluginContainerImpl::handleEvent):
     20
    1212012-12-06  David Grogan  <dgrogan@chromium.org>
    222
  • trunk/Source/WebKit/chromium/public/WebInputEvent.h

    r136383 r136899  
    204204    }
    205205
     206    // Returns true if the WebInputEvent |type| should be handled as user gesture.
     207    static bool isUserGestureEventType(int type)
     208    {
     209        return isKeyboardEventType(type)
     210            || type == MouseDown
     211            || type == MouseUp
     212            || type == TouchStart
     213            || type == TouchEnd;
     214    }
     215
    206216    // Returns true if the WebInputEvent is a gesture event.
    207217    static bool isGestureEventType(int type)
  • trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp

    r136186 r136899  
    186186        return;
    187187
     188    const WebInputEvent* currentInputEvent = WebViewImpl::currentInputEvent();
     189    UserGestureIndicator gestureIndicator(currentInputEvent && WebInputEvent::isUserGestureEventType(currentInputEvent->type) ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     190
    188191    RefPtr<WebPluginContainerImpl> protector(this);
    189192    // The events we pass are defined at:
  • trunk/Tools/ChangeLog

    r136896 r136899  
     12012-12-06  Jochen Eisinger  <jochen@chromium.org>
     2
     3        [chromium] when forwarding events through the WebPluginContainer, create a UserGestureIndicator if processing a user gesture
     4        https://bugs.webkit.org/show_bug.cgi?id=104306
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * DumpRenderTree/chromium/TestWebPlugin.cpp:
     9        (TestWebPlugin::TestWebPlugin):
     10        (TestWebPlugin::handleInputEvent): add support for printing the user gesture status
     11        * DumpRenderTree/chromium/TestWebPlugin.h:
     12        (TestWebPlugin):
     13
    1142012-12-06  Dirk Pranke  <dpranke@chromium.org>
    215
  • trunk/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp

    r136013 r136899  
    138138    , m_touchEventRequest(WebKit::WebPluginContainer::TouchEventRequestTypeNone)
    139139    , m_printEventDetails(false)
     140    , m_printUserGestureStatus(false)
    140141    , m_canProcessDrag(false)
    141142{
     
    147148    static const WebString kAttributePrintEventDetails = WebString::fromUTF8("print-event-details");
    148149    static const WebString kAttributeCanProcessDrag = WebString::fromUTF8("can-process-drag");
     150    static const WebString kAttributePrintUserGestureStatus = WebString::fromUTF8("print-user-gesture-status");
    149151
    150152    ASSERT(params.attributeNames.size() == params.attributeValues.size());
     
    168170        else if (attributeName == kAttributeCanProcessDrag)
    169171            m_canProcessDrag = parseBoolean(attributeValue);
     172        else if (attributeName == kAttributePrintUserGestureStatus)
     173            m_printUserGestureStatus = parseBoolean(attributeValue);
    170174    }
    171175}
     
    487491    if (m_printEventDetails)
    488492        printEventDetails(event);
     493    if (m_printUserGestureStatus)
     494        printf("* %shandling user gesture\n", m_frame->isProcessingUserGesture() ? "" : "not ");
    489495    return false;
    490496}
  • trunk/Tools/DumpRenderTree/chromium/TestWebPlugin.h

    r136013 r136899  
    135135    WebKit::WebPluginContainer::TouchEventRequestType m_touchEventRequest;
    136136    bool m_printEventDetails;
     137    bool m_printUserGestureStatus;
    137138    bool m_canProcessDrag;
    138139};
Note: See TracChangeset for help on using the changeset viewer.