Changeset 102540 in webkit
- Timestamp:
- Dec 11, 2011 11:38:49 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r102538 r102540 1 2011-12-11 Andreas Kling <kling@webkit.org> 2 3 WK2/NetscapePlugin: Incorrect mouse event coordinates when frameScaleFactor != 1. 4 <http://webkit.org/b/74209> and <rdar://problem/10438197> 5 6 Reviewed by Anders Carlsson. 7 8 Add a test verifying that NetscapePlugins receive correctly transformed 9 mouse events with a page scale factor applied. 10 11 * platform/mac-wk2/plugins/mouse-events-scaled-expected.txt: Added. 12 * platform/mac-wk2/plugins/mouse-events-scaled.html: Added. 13 1 14 2011-12-11 Dan Bernstein <mitz@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r102539 r102540 1 2011-12-11 Andreas Kling <kling@webkit.org> 2 3 WK2/NetscapePlugin: Incorrect mouse event coordinates when frameScaleFactor != 1. 4 <http://webkit.org/b/74209> and <rdar://problem/10438197> 5 6 Reviewed by Anders Carlsson. 7 8 * WebCore.exp.in: Export AffineTransform::scale(double). 9 1 10 2011-12-10 Andreas Kling <kling@webkit.org> 2 11 -
trunk/Source/WebCore/WebCore.exp.in
r102517 r102540 408 408 __ZN7WebCore14endOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE 409 409 __ZN7WebCore15AffineTransform5flipYEv 410 __ZN7WebCore15AffineTransform5scaleEd 410 411 __ZN7WebCore15AffineTransform8multiplyERKS0_ 411 412 __ZN7WebCore15AffineTransform9translateEdd -
trunk/Source/WebKit2/ChangeLog
r102533 r102540 1 2011-12-11 Andreas Kling <kling@webkit.org> 2 3 WK2/NetscapePlugin: Incorrect mouse event coordinates when frameScaleFactor != 1. 4 <http://webkit.org/b/74209> and <rdar://problem/10438197> 5 6 Reviewed by Anders Carlsson. 7 8 * Shared/WebEvent.h: 9 * Shared/WebMouseEvent.cpp: 10 11 Remove the WebMouseEvent "copy" constructor that applied a scale factor 12 to the coordinates of an existing event. 13 14 * WebProcess/Plugins/PluginView.cpp: 15 (WebKit::PluginView::handleEvent): 16 17 Pass the WebMouseEvent through to the plugin unmodified. 18 19 (WebKit::PluginView::viewGeometryDidChange): 20 21 Plumb a complex translate+scale transform through to the plugin, so coordinate 22 space transformations in will behave correctly with scale factors other than 1. 23 1 24 2011-12-10 Sam Weinig <sam@webkit.org> 2 25 -
trunk/Source/WebKit2/Shared/WebEvent.h
r99837 r102540 126 126 WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, bool didActivateWebView); 127 127 #endif 128 129 WebMouseEvent(const WebMouseEvent&, float pageScaleFactor);130 128 131 129 Button button() const { return static_cast<Button>(m_button); } -
trunk/Source/WebKit2/Shared/WebMouseEvent.cpp
r95901 r102540 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 #endif93 {94 }95 96 81 void WebMouseEvent::encode(CoreIPC::ArgumentEncoder* encoder) const 97 82 { -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r100895 r102540 634 634 if (currentEvent->type() == WebEvent::MouseDown) 635 635 focusPluginElement(); 636 637 // Adjust mouse coordinates to account for frameScaleFactor 638 WebMouseEvent eventWithScaledCoordinates(*static_cast<const WebMouseEvent*>(currentEvent), frame()->frameScaleFactor()); 639 didHandleEvent = m_plugin->handleMouseEvent(eventWithScaledCoordinates); 636 637 didHandleEvent = m_plugin->handleMouseEvent(static_cast<const WebMouseEvent&>(*currentEvent)); 640 638 } else if (event->type() == eventNames().mousewheelEvent && currentEvent->type() == WebEvent::Wheel) { 641 639 // We have a wheel event. … … 707 705 return; 708 706 709 // FIXME: Just passing a translation matrix isn't good enough. 710 IntPoint locationInWindowCoordinates = parent()->contentsToRootView(frameRect().location()); 711 AffineTransform transform = AffineTransform::translation(locationInWindowCoordinates.x(), locationInWindowCoordinates.y()); 707 ASSERT(frame()); 708 float frameScaleFactor = frame()->frameScaleFactor(); 709 710 IntPoint scaledFrameRectLocation(frameRect().location().x() * frameScaleFactor, frameRect().location().y() * frameScaleFactor); 711 IntPoint scaledLocationInRootViewCoordinates(parent()->contentsToRootView(scaledFrameRectLocation)); 712 713 // FIXME: We still don't get the right coordinates for transformed plugins. 714 AffineTransform transform; 715 transform.translate(scaledLocationInRootViewCoordinates.x(), scaledLocationInRootViewCoordinates.y()); 716 transform.scale(frameScaleFactor); 712 717 713 718 // FIXME: The clip rect isn't correct.
Note: See TracChangeset
for help on using the changeset viewer.