Changeset 86615 in webkit
- Timestamp:
- May 16, 2011 3:32:18 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r86612 r86615 1 2011-05-16 Chris Marrin <cmarrin@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Plug-in hit testing is broken after zooming 6 https://bugs.webkit.org/show_bug.cgi?id=60916 7 8 Construct a WebMouseEvent to send to plugin, adjusting values to take pageScaleFactor 9 into account. Also adjusted bounds sent to viewGeometryDidChange to take pageScaleFactor 10 into account. Both are needed or the plugin will think the mouse positions are outside 11 its bounds. 12 13 * Shared/WebEvent.h: 14 * Shared/WebMouseEvent.cpp:Add ctor to clone a WebMouseEvent and add a scaleFactor to values 15 (WebKit::WebMouseEvent::WebMouseEvent): 16 * WebProcess/Plugins/PluginView.cpp: 17 (WebKit::PluginView::handleEvent):Adjust mouse coords to take pageScaleFactor into account 18 (WebKit::PluginView::viewGeometryDidChange):Adjust bounds to take pageScaleFactor into account 19 1 20 2011-05-16 Martin Robinson <mrobinson@igalia.com> 2 21 -
trunk/Source/WebKit2/Shared/WebEvent.h
r82896 r86615 125 125 WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, bool didActivateWebView); 126 126 #endif 127 128 WebMouseEvent(const WebMouseEvent&, float pageScaleFactor); 127 129 128 130 Button button() const { return static_cast<Button>(m_button); } -
trunk/Source/WebKit2/Shared/WebMouseEvent.cpp
r82733 r86615 79 79 #endif 80 80 81 WebMouseEvent::WebMouseEvent(const WebMouseEvent& event, float pageScaleFactor) 82 : WebEvent(event.type(), event.modifiers(), event.timestamp()) 83 , m_button(event.button()) 84 , m_position(WebCore::IntPoint(event.position().x() / pageScaleFactor, event.position().y() / pageScaleFactor)) 85 , m_globalPosition(m_position + (event.globalPosition() - event.position())) 86 , m_deltaX(event.deltaX()) 87 , m_deltaY(event.deltaY()) 88 , m_deltaZ(event.deltaZ()) 89 , m_clickCount(event.clickCount()) 90 #if PLATFORM(WIN) 91 , m_didActivateWebView(false) 92 #endif 93 { 94 } 95 81 96 void WebMouseEvent::encode(CoreIPC::ArgumentEncoder* encoder) const 82 97 { -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r86577 r86615 39 39 #include <WebCore/CredentialStorage.h> 40 40 #include <WebCore/DocumentLoader.h> 41 #include <WebCore/ Event.h>41 #include <WebCore/MouseEvent.h> 42 42 #include <WebCore/FocusController.h> 43 43 #include <WebCore/Frame.h> … … 576 576 if (currentEvent->type() == WebEvent::MouseDown) 577 577 focusPluginElement(); 578 579 didHandleEvent = m_plugin->handleMouseEvent(static_cast<const WebMouseEvent&>(*currentEvent)); 578 579 // Adjust mouse coordinates to account for pageScaleFactor 580 float scaleFactor = frame()->pageScaleFactor(); 581 WebMouseEvent eventWithScaledCoordinates(*(static_cast<const WebMouseEvent*>(currentEvent)), scaleFactor); 582 didHandleEvent = m_plugin->handleMouseEvent(eventWithScaledCoordinates); 580 583 } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel) { 581 584 // We have a wheel event. … … 641 644 // Get the frame rect in window coordinates. 642 645 IntRect frameRectInWindowCoordinates = parent()->contentsToWindow(frameRect()); 646 647 // Adjust bounds to account for pageScaleFactor 648 float scaleFactor = frame()->pageScaleFactor(); 649 frameRectInWindowCoordinates.setX(frameRectInWindowCoordinates.x() / scaleFactor); 650 frameRectInWindowCoordinates.setY(frameRectInWindowCoordinates.y() / scaleFactor); 643 651 frameRectInWindowCoordinates.setSize(m_boundsSize); 644 652 m_plugin->geometryDidChange(frameRectInWindowCoordinates, clipRectInWindowCoordinates());
Note: See TracChangeset
for help on using the changeset viewer.