WebKitTools:
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 00:33:33 +0000 (00:33 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 00:33:33 +0000 (00:33 +0000)
        Reviewed by Darin.

        <rdar://problem/5132001>
        contextClick is not implemented in DRT on Windows.

        * DumpRenderTree/win/EventSender.cpp:
        (contextClickCallback):
        Add a callback for contextClick, which sends a WM_RBUTTONDOWN message followed
        by a WM_RBUTTONUP message.

        * DumpRenderTree/win/UIDelegate.cpp:
        (UIDelegate::hasCustomMenuImplementation):
        (UIDelegate::trackCustomPopupMenu):
        * DumpRenderTree/win/UIDelegate.h:
        Add a no-op implementation of trackCustomPopupMenu, to prevent the default popup
        menu from being shown (and causing the DRT to hang).

LayoutTests:

        Reviewed by Darin.

        <rdar://problem/5132001>
        contextClick is not implemented in DRT on Windows.

        Remove tests that pass now that we have contextClick.

        * platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28123 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/win/Skipped
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/win/EventSender.cpp
WebKitTools/DumpRenderTree/win/UIDelegate.cpp
WebKitTools/DumpRenderTree/win/UIDelegate.h

index d8f0936776f5747815117de799e44234f181200c..c6f91a89e82f5eb0c4ba282c9e26225bd4681f0f 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-28  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Darin.
+
+        <rdar://problem/5132001>
+        contextClick is not implemented in DRT on Windows.
+
+        Remove tests that pass now that we have contextClick.
+        
+        * platform/win/Skipped:
+
 2007-11-28  Alice Liu  <alice.liu@apple.com>
 
         Removing some tests tracked by <rdar://5130762> because they don't fail.
index 5ea8bd2874f60619d696be4caafc8c43d158f126..c546f720d42c0581274c979d4a4f2f7879230f62 100644 (file)
@@ -410,11 +410,6 @@ editing/pasteboard/emacs-ctrl-a-k-y.html
 editing/pasteboard/emacs-ctrl-k-y-001.html
 editing/pasteboard/emacs-cntl-y-001.html
 
-# eventSender.contextClick is unimplemented <rdar://problem/5132001>
-editing/selection/5109817.html
-editing/selection/5354455-1.html
-editing/selection/5354455-2.html
-
 # These tests time out <rdar://problem/5382558>
 http/tests/security/cross-frame-access-protocol-explicit-domain.html
 http/tests/security/cross-frame-access-protocol.html
index 3e6b93653044863a241ff47f65d03a335a21ea8c..20c126621aac855e83c46514c63731098e432430 100644 (file)
@@ -1,3 +1,22 @@
+2007-11-28  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Darin.
+
+        <rdar://problem/5132001>
+        contextClick is not implemented in DRT on Windows.
+        
+        * DumpRenderTree/win/EventSender.cpp:
+        (contextClickCallback):
+        Add a callback for contextClick, which sends a WM_RBUTTONDOWN message followed
+        by a WM_RBUTTONUP message.
+        
+        * DumpRenderTree/win/UIDelegate.cpp:
+        (UIDelegate::hasCustomMenuImplementation):
+        (UIDelegate::trackCustomPopupMenu):
+        * DumpRenderTree/win/UIDelegate.h:
+        Add a no-op implementation of trackCustomPopupMenu, to prevent the default popup
+        menu from being shown (and causing the DRT to hang).
+
 2007-11-27  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin.
index be9d6471725923ce0c580a2b44deca20e1b062c8..4c0facdf45bb270c4806be1d225ef2dee5cdd80d 100644 (file)
@@ -99,6 +99,22 @@ static LRESULT dispatchMessage(const MSG* msg)
     return ::DispatchMessage(msg);
 }
 
+static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    COMPtr<IWebFramePrivate> framePrivate;
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
+        framePrivate->layout();
+
+    down = true;
+    MSG msg = makeMsg(webViewWindow, WM_RBUTTONDOWN, 0, MAKELPARAM(lastMousePosition.x, lastMousePosition.y));
+    dispatchMessage(&msg);
+    down = false;
+    msg = makeMsg(webViewWindow, WM_RBUTTONUP, 0, MAKELPARAM(lastMousePosition.x, lastMousePosition.y));
+    dispatchMessage(&msg);
+    
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     COMPtr<IWebFramePrivate> framePrivate;
@@ -335,6 +351,7 @@ static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function
 }
 
 static JSStaticFunction staticFunctions[] = {
+    { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "mouseUp", mouseUpCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "mouseMoveTo", mouseMoveToCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
index 53242954d6287bc930957c4f9b5b772380a6e3a2..2b00d4dbf4b08f3483f8ea4a80f28b846a8a8346 100755 (executable)
@@ -82,11 +82,20 @@ ULONG STDMETHODCALLTYPE UIDelegate::Release()
 HRESULT STDMETHODCALLTYPE UIDelegate::hasCustomMenuImplementation( 
         /* [retval][out] */ BOOL *hasCustomMenus)
 {
-    *hasCustomMenus = FALSE;
+    *hasCustomMenus = TRUE;
 
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE UIDelegate::trackCustomPopupMenu( 
+        /* [in] */ IWebView *sender,
+        /* [in] */ OLE_HANDLE menu,
+        /* [in] */ LPPOINT point)
+{
+    // Do nothing
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE UIDelegate::setFrame( 
         /* [in] */ IWebView* /*sender*/,
         /* [in] */ RECT* frame)
index 881f125b894d3676dd6cbcbbe2de8696a887f6d6..6ce50de5d681088bf6b26e8523db087b979b2ee1 100755 (executable)
@@ -197,7 +197,7 @@ public:
     virtual HRESULT STDMETHODCALLTYPE trackCustomPopupMenu( 
         /* [in] */ IWebView *sender,
         /* [in] */ OLE_HANDLE menu,
-        /* [in] */ LPPOINT point) { return E_NOTIMPL; }
+        /* [in] */ LPPOINT point);
        
     virtual HRESULT STDMETHODCALLTYPE measureCustomMenuItem( 
         /* [in] */ IWebView *sender,