Changeset 96439 in webkit
- Timestamp:
- Sep 30, 2011 5:16:48 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96433 r96439 1 2011-09-30 Sam Weinig <sam@webkit.org> 2 3 Add support for eventSender.mouseScrollBy in WTR 4 https://bugs.webkit.org/show_bug.cgi?id=69189 5 6 Reviewed by Simon Fraser. 7 8 * platform/mac-wk2/Skipped: 9 Removes tests that used eventSender.mouseScrollBy. 10 1 11 2011-09-30 Johnny Ding <jnd@chromium.org> 2 12 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r95660 r96439 148 148 fast/events/ondragenter.html 149 149 fast/events/open-window-from-another-frame.html 150 fast/events/platform-wheelevent-in-scrolling-div.html151 150 fast/events/popup-blocking-click-in-iframe.html 152 151 fast/events/popup-when-select-change.html 153 152 fast/events/prevent-drag-to-navigate.html 154 fast/events/remove-child-onscroll.html155 153 fast/events/right-click-focus.html 156 154 fast/events/scroll-after-click-on-tab-index.html 157 fast/events/scroll-in-scaled-page-with-overflow-hidden.html158 155 fast/events/selectstart-by-drag.html 159 156 fast/events/selectstart-prevent-selection-on-right-click.html -
trunk/Source/WebKit2/ChangeLog
r96435 r96439 1 2011-09-30 Sam Weinig <sam@webkit.org> 2 3 Add support for eventSender.mouseScrollBy in WTR 4 https://bugs.webkit.org/show_bug.cgi?id=69189 5 6 Reviewed by Simon Fraser. 7 8 * UIProcess/WebPageProxy.cpp: 9 (WebKit::WebPageProxy::handleWheelEvent): 10 * WebProcess/WebPage/WebPage.cpp: 11 (WebKit::WebPage::wheelEventSyncForTesting): 12 * WebProcess/WebPage/WebPage.h: 13 * WebProcess/WebPage/WebPage.messages.in: 14 Add sync version of wheel event handling for use in testing. 15 1 16 2011-09-30 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 17 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r96413 r96439 870 870 871 871 process()->responsivenessTimer()->start(); 872 process()->send(Messages::WebPage::WheelEvent(event), m_pageID); 872 873 if (m_shouldSendEventsSynchronously) { 874 bool handled = false; 875 process()->sendSync(Messages::WebPage::WheelEventSyncForTesting(event), Messages::WebPage::WheelEventSyncForTesting::Reply(handled), m_pageID); 876 didReceiveEvent(event.type(), handled); 877 } else 878 process()->send(Messages::WebPage::WheelEvent(event), m_pageID); 873 879 } 874 880 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r96435 r96439 1134 1134 } 1135 1135 1136 void WebPage::wheelEventSyncForTesting(const WebWheelEvent& wheelEvent, bool& handled) 1137 { 1138 CurrentEvent currentEvent(wheelEvent); 1139 1140 #if PLATFORM(MAC) 1141 if (wheelEvent.momentumPhase() == WebWheelEvent::PhaseBegan || wheelEvent.phase() == WebWheelEvent::PhaseBegan) 1142 m_drawingArea->disableDisplayThrottling(); 1143 else if (wheelEvent.momentumPhase() == WebWheelEvent::PhaseEnded || wheelEvent.phase() == WebWheelEvent::PhaseEnded) 1144 m_drawingArea->enableDisplayThrottling(); 1145 #endif 1146 1147 handled = handleWheelEvent(wheelEvent, m_page.get()); 1148 } 1149 1136 1150 static bool handleKeyEvent(const WebKeyboardEvent& keyboardEvent, Page* page) 1137 1151 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r95968 r96439 490 490 void mouseEventSyncForTesting(const WebMouseEvent&, bool&); 491 491 void wheelEvent(const WebWheelEvent&); 492 void wheelEventSyncForTesting(const WebWheelEvent&, bool&); 492 493 void keyEvent(const WebKeyboardEvent&); 493 494 void keyEventSyncForTesting(const WebKeyboardEvent&, bool&); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r95660 r96439 38 38 MouseEventSyncForTesting(WebKit::WebMouseEvent event) -> (bool handled) 39 39 WheelEvent(WebKit::WebWheelEvent event) 40 WheelEventSyncForTesting(WebKit::WebWheelEvent event) -> (bool handled) 40 41 #if ENABLE(GESTURE_EVENTS) 41 42 GestureEvent(WebKit::WebGestureEvent event) -
trunk/Tools/ChangeLog
r96434 r96439 1 2011-09-30 Sam Weinig <sam@webkit.org> 2 3 Add support for eventSender.mouseScrollBy in WTR 4 https://bugs.webkit.org/show_bug.cgi?id=69189 5 6 Add implementation of eventSender.mouseScrollBy for the mac. 7 8 Reviewed by Simon Fraser. 9 10 * WebKitTestRunner/EventSenderProxy.h: 11 * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl: 12 * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: 13 (WTR::EventSendingController::keyDown): 14 (WTR::EventSendingController::mouseScrollBy): 15 * WebKitTestRunner/InjectedBundle/EventSendingController.h: 16 * WebKitTestRunner/TestController.cpp: 17 (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle): 18 * WebKitTestRunner/mac/EventSenderProxy.mm: 19 (WTR::EventSenderProxy::mouseScrollBy): 20 1 21 2011-09-30 Simon Fraser <simon.fraser@apple.com> 2 22 -
trunk/Tools/WebKitTestRunner/EventSenderProxy.h
r96402 r96439 39 39 void mouseUp(unsigned button, WKEventModifiers); 40 40 void mouseMoveTo(double x, double y); 41 void mouseScrollBy(int x, int y); 42 41 43 void leapForward(int milliseconds); 42 44 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
r95039 r96439 30 30 void mouseUp(in long buttonNumber, in object modifierArray); 31 31 void mouseMoveTo(in long x, in long y); 32 void mouseScrollBy(in long x, in long y); 33 32 34 void leapForward(in long milliseconds); 33 35 -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
r95908 r96439 218 218 } 219 219 220 void EventSendingController::keyDown(JSStringRef key, JSValueRef modifierArray, int location) 221 { 222 WKBundlePageRef page = InjectedBundle::shared().page()->page(); 223 WKBundleFrameRef frame = WKBundlePageGetMainFrame(page); 224 JSContextRef context = WKBundleFrameGetJavaScriptContext(frame); 225 WKEventModifiers modifiers = parseModifierArray(context, modifierArray); 226 227 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender")); 228 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate()); 229 230 WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage")); 231 WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("KeyDown")); 232 WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 233 234 WKRetainPtr<WKStringRef> keyKey = adoptWK(WKStringCreateWithUTF8CString("Key")); 235 WKDictionaryAddItem(EventSenderMessageBody.get(), keyKey.get(), toWK(key).get()); 236 237 WKRetainPtr<WKStringRef> modifiersKey = adoptWK(WKStringCreateWithUTF8CString("Modifiers")); 238 WKRetainPtr<WKUInt64Ref> modifiersRef = WKUInt64Create(modifiers); 239 WKDictionaryAddItem(EventSenderMessageBody.get(), modifiersKey.get(), modifiersRef.get()); 240 241 WKRetainPtr<WKStringRef> locationKey = adoptWK(WKStringCreateWithUTF8CString("Location")); 242 WKRetainPtr<WKUInt64Ref> locationRef = WKUInt64Create(location); 243 WKDictionaryAddItem(EventSenderMessageBody.get(), locationKey.get(), locationRef.get()); 244 245 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); 246 } 247 248 void EventSendingController::mouseScrollBy(int x, int y) 249 { 250 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender")); 251 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate()); 252 253 WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage")); 254 WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("MouseScrollBy")); 255 WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 256 257 WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X")); 258 WKRetainPtr<WKDoubleRef> xRef = WKDoubleCreate(x); 259 WKDictionaryAddItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 260 261 WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y")); 262 WKRetainPtr<WKDoubleRef> yRef = WKDoubleCreate(y); 263 WKDictionaryAddItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 264 265 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); 266 } 220 267 221 268 #ifdef USE_WEBPROCESS_EVENT_SIMULATION … … 284 331 } 285 332 286 void EventSendingController::keyDown(JSStringRef key, JSValueRef modifierArray, int location)287 {288 WKBundlePageRef page = InjectedBundle::shared().page()->page();289 WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);290 JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);291 WKEventModifiers modifiers = parseModifierArray(context, modifierArray);292 293 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));294 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());295 296 WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));297 WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("KeyDown"));298 WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());299 300 WKRetainPtr<WKStringRef> keyKey = adoptWK(WKStringCreateWithUTF8CString("Key"));301 WKDictionaryAddItem(EventSenderMessageBody.get(), keyKey.get(), toWK(key).get());302 303 WKRetainPtr<WKStringRef> modifiersKey = adoptWK(WKStringCreateWithUTF8CString("Modifiers"));304 WKRetainPtr<WKUInt64Ref> modifiersRef = WKUInt64Create(modifiers);305 WKDictionaryAddItem(EventSenderMessageBody.get(), modifiersKey.get(), modifiersRef.get());306 307 WKRetainPtr<WKStringRef> locationKey = adoptWK(WKStringCreateWithUTF8CString("Location"));308 WKRetainPtr<WKUInt64Ref> locationRef = WKUInt64Create(location);309 WKDictionaryAddItem(EventSenderMessageBody.get(), locationKey.get(), locationRef.get());310 311 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);312 }313 314 333 } // namespace WTR -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
r95878 r96439 51 51 void mouseUp(int button, JSValueRef modifierArray); 52 52 void mouseMoveTo(int x, int y); 53 void mouseScrollBy(int x, int y); 53 54 void leapForward(int milliseconds); 54 55 -
trunk/Tools/WebKitTestRunner/TestController.cpp
r95660 r96439 575 575 } 576 576 577 if (WKStringIsEqualToUTF8CString(subMessageName, "MouseScrollBy")) { 578 WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X")); 579 double x = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get()))); 580 581 WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y")); 582 double y = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get()))); 583 584 // Forward to WebProcess 585 WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true); 586 m_eventSenderProxy->mouseScrollBy(x, y); 587 WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false); 588 return 0; 589 } 590 577 591 if (WKStringIsEqualToUTF8CString(subMessageName, "LeapForward")) { 578 592 WKRetainPtr<WKStringRef> timeKey = adoptWK(WKStringCreateWithUTF8CString("TimeInMilliseconds")); -
trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
r95878 r96439 28 28 #import "EventSenderProxy.h" 29 29 30 #import "PlatformWebView.h" 30 31 #import "StringFunctions.h" 31 #import "PlatformWebView.h"32 32 #import "TestController.h" 33 #import <JavaScriptCore/RetainPtr.h> 33 34 #import <WebKit2/WKString.h> 34 35 … … 352 353 } 353 354 355 void EventSenderProxy::mouseScrollBy(int x, int y) 356 { 357 RetainPtr<CGEventRef> cgScrollEvent(AdoptCF, CGEventCreateScrollWheelEvent(0, kCGScrollEventUnitLine, 2, y, x)); 358 359 // CGEvent locations are in global display coordinates. 360 CGPoint lastGlobalMousePosition = { 361 m_position.x, 362 [[NSScreen mainScreen] frame].size.height - m_position.y 363 }; 364 CGEventSetLocation(cgScrollEvent.get(), lastGlobalMousePosition); 365 366 NSEvent *event = [NSEvent eventWithCGEvent:cgScrollEvent.get()]; 367 NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]]; 368 if (targetView) 369 [targetView scrollWheel:event]; 370 } 371 354 372 } // namespace WTR -
trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
r96402 r96439 296 296 } 297 297 298 void EventSenderProxy::mouseScrollBy(int, int) 299 { 300 // FIXME: Implement this. 301 } 302 298 303 void EventSenderProxy::leapForward(int ms) 299 304 {
Note: See TracChangeset
for help on using the changeset viewer.