Changeset 55758 in webkit


Ignore:
Timestamp:
Mar 9, 2010 5:44:59 PM (14 years ago)
Author:
jam@chromium.org
Message:

Reviewed by Darin Fisher.

Need to send mouse events to plugin when it has mouse capture
https://bugs.webkit.org/show_bug.cgi?id=35900

  • public/WebInputEvent.h:

(WebKit::WebInputEvent::isMouseEventType):

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::mouseDown):
(WebKit::WebViewImpl::mouseUp):
(WebKit::WebViewImpl::handleInputEvent):

  • src/WebViewImpl.h:
Location:
trunk/WebKit/chromium
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r55748 r55758  
     12010-03-08  John Abd-El-Malek  <jam@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Need to send mouse events to plugin when it has mouse capture
     6        https://bugs.webkit.org/show_bug.cgi?id=35900
     7
     8        * public/WebInputEvent.h:
     9        (WebKit::WebInputEvent::isMouseEventType):
     10        * src/WebViewImpl.cpp:
     11        (WebKit::WebViewImpl::WebViewImpl):
     12        (WebKit::WebViewImpl::mouseDown):
     13        (WebKit::WebViewImpl::mouseUp):
     14        (WebKit::WebViewImpl::handleInputEvent):
     15        * src/WebViewImpl.h:
     16
    1172010-03-09  Anton Muhin  <antonm@chromium.org>
    218
  • trunk/WebKit/chromium/public/WebInputEvent.h

    r55507 r55758  
    129129    double timeStampSeconds;   // Seconds since epoch.
    130130
     131    // Returns true if the WebInputEvent |type| is a mouse event.
     132    static bool isMouseEventType(int type)
     133    {
     134        return type == MouseDown
     135            || type == MouseUp
     136            || type == MouseMove
     137            || type == MouseEnter
     138            || type == MouseLeave;
     139    }
     140
    131141    // Returns true if the WebInputEvent |type| is a keyboard event.
    132142    static bool isKeyboardEventType(int type)
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r55686 r55758  
    246246    , m_isTransparent(false)
    247247    , m_tabsToLinks(false)
     248    , m_haveMouseCapture(false)
    248249{
    249250    // WebKit/win/WebView.cpp does the same thing, except they call the
     
    328329
    329330    m_lastMouseDownPoint = WebPoint(event.x, event.y);
     331    m_haveMouseCapture = true;
    330332
    331333    // If a text field that has focus is clicked again, we should display the
     
    442444#endif
    443445
    444     mouseCaptureLost();
    445446    mainFrameImpl()->frame()->eventHandler()->handleMouseReleaseEvent(
    446447        PlatformMouseEventBuilder(mainFrameImpl()->frameView(), event));
     
    900901        return true;
    901902
     903    if (m_haveMouseCapture && WebInputEvent::isMouseEventType(inputEvent.type)) {
     904        Node* node = focusedWebCoreNode();
     905        if (node && node->renderer() && node->renderer()->isEmbeddedObject()) {
     906            AtomicString eventType;
     907            switch (inputEvent.type) {
     908            case WebInputEvent::MouseMove:
     909                eventType = eventNames().mousemoveEvent;
     910                break;
     911            case WebInputEvent::MouseLeave:
     912                eventType = eventNames().mouseoutEvent;
     913                break;
     914            case WebInputEvent::MouseDown:
     915                eventType = eventNames().mousedownEvent;
     916                break;
     917            case WebInputEvent::MouseUp:
     918                eventType = eventNames().mouseupEvent;
     919                break;
     920            default:
     921                ASSERT_NOT_REACHED();
     922            }
     923
     924            node->dispatchMouseEvent(
     925                  PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)),
     926                  eventType);
     927            return true;
     928        }
     929    }
     930
    902931    // FIXME: Remove m_currentInputEvent.
    903932    // This only exists to allow ChromeClient::show() to know which mouse button
     
    955984void WebViewImpl::mouseCaptureLost()
    956985{
     986    m_haveMouseCapture = false;
    957987}
    958988
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r54586 r55758  
    447447#endif
    448448
     449    bool m_haveMouseCapture;
     450
    449451    static const WebInputEvent* m_currentInputEvent;
    450452};
Note: See TracChangeset for help on using the changeset viewer.