[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

commit-queue at webkit.org commit-queue at webkit.org
Fri Jan 21 14:56:32 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 0797b8ac01b43904208de1bda2f6a86f3c2fa061
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 5 03:08:06 2011 +0000

    2011-01-04  Jeff Miller  <jeffm at apple.com>
    
            Reviewed by Darin Adler.
    
            Member variable and method naming cleanup to be consistent with WebKit2.
            https://bugs.webkit.org/show_bug.cgi?id=51228
    
            * page/win/EventHandlerWin.cpp:
            (WebCore::EventHandler::eventActivatedView):
            Rename activatedWebView() to didActivateWebView().
    
            * platform/PlatformMouseEvent.h:
            Rename m_activatedWebView to m_didActivateWebView.
    
            (WebCore::PlatformMouseEvent::PlatformMouseEvent):
            Initialize platform-specific member variables in PlatformMouseEvent constructors.
    
            (WebCore::PlatformMouseEvent::didActivateWebView):
            Rename activatedWebView() to didActivateWebView().
    
            * platform/win/PlatformMouseEventWin.cpp:
            (WebCore::PlatformMouseEvent::PlatformMouseEvent):
            Rename m_activatedWebView to m_didActivateWebView.
    2011-01-04  Jeff Miller  <jeffm at apple.com>
    
            Reviewed by Darin Adler.
    
            Mouse events in WebKit2 on Windows need to know whether the click activated the WebView to match WebKit1 behavior.
            https://bugs.webkit.org/show_bug.cgi?id=51228
    
            * Shared/WebEvent.h:
            (WebKit::WebMouseEvent::didActivateWebView):
            Add m_didActivateWebView to WebMouseEvent on Windows.
    
            * Shared/WebEventConversion.cpp:
            (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
            Propagate whether the click activated the WebView when converting to a PlatformMouseEvent.
    
            * Shared/WebMouseEvent.cpp:
            (WebKit::WebMouseEvent::WebMouseEvent):
            Add m_didActivateWebView to WebMouseEvent on Windows.
    
            (WebKit::WebMouseEvent::encode):
            (WebKit::WebMouseEvent::decode):
            Encode and decode new m_didActivateWebView member variable.
    
            * Shared/win/WebEventFactory.cpp:
            (WebKit::WebEventFactory::createWebMouseEvent):
            * Shared/win/WebEventFactory.h:
            Add didActivateWebView parameter to createWebMouseEvent().
    
            * UIProcess/win/WebView.cpp:
            (WebKit::WebView::wndProc):
            (WebKit::WebView::WebView):
            (WebKit::WebView::onMouseEvent):
            * UIProcess/win/WebView.h:
            (WebKit::WebView::setWasActivatedByMouseEvent):
            Keep track of whether the click activated the WebView.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75040 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9fee8d1..16a964b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2011-01-04  Jeff Miller  <jeffm at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Member variable and method naming cleanup to be consistent with WebKit2.
+        https://bugs.webkit.org/show_bug.cgi?id=51228
+
+        * page/win/EventHandlerWin.cpp:
+        (WebCore::EventHandler::eventActivatedView):
+        Rename activatedWebView() to didActivateWebView().
+        
+        * platform/PlatformMouseEvent.h:
+        Rename m_activatedWebView to m_didActivateWebView.
+        
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+        Initialize platform-specific member variables in PlatformMouseEvent constructors.
+        
+        (WebCore::PlatformMouseEvent::didActivateWebView):
+        Rename activatedWebView() to didActivateWebView().
+
+        * platform/win/PlatformMouseEventWin.cpp:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+        Rename m_activatedWebView to m_didActivateWebView.
+
 2011-01-04  Yael Aharon  <yael.aharon at nokia.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/page/win/EventHandlerWin.cpp b/WebCore/page/win/EventHandlerWin.cpp
index a1c15c5..039d70b 100644
--- a/WebCore/page/win/EventHandlerWin.cpp
+++ b/WebCore/page/win/EventHandlerWin.cpp
@@ -88,7 +88,7 @@ bool EventHandler::tabsToAllControls(KeyboardEvent*) const
 
 bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
 {
-    return event.activatedWebView();
+    return event.didActivateWebView();
 }
 
 PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
diff --git a/WebCore/platform/PlatformMouseEvent.h b/WebCore/platform/PlatformMouseEvent.h
index 725945a..6d307d1 100644
--- a/WebCore/platform/PlatformMouseEvent.h
+++ b/WebCore/platform/PlatformMouseEvent.h
@@ -85,6 +85,11 @@ namespace WebCore {
             , m_metaKey(false)
             , m_timestamp(0)
             , m_modifierFlags(0)
+#if PLATFORM(MAC)
+            , m_eventNumber(0)
+#elif PLATFORM(WIN)
+            , m_didActivateWebView(false)
+#endif
         {
         }
 
@@ -101,6 +106,11 @@ namespace WebCore {
             , m_metaKey(meta)
             , m_timestamp(timestamp)
             , m_modifierFlags(0)
+#if PLATFORM(MAC)
+            , m_eventNumber(0)
+#elif PLATFORM(WIN)
+            , m_didActivateWebView(false)
+#endif
         {
         }
 
@@ -150,9 +160,9 @@ namespace WebCore {
 #endif
 
 #if PLATFORM(WIN)
-        PlatformMouseEvent(HWND, UINT, WPARAM, LPARAM, bool activatedWebView = false);
+        PlatformMouseEvent(HWND, UINT, WPARAM, LPARAM, bool didActivateWebView = false);
         void setClickCount(int count) { m_clickCount = count; }
-        bool activatedWebView() const { return m_activatedWebView; }
+        bool didActivateWebView() const { return m_didActivateWebView; }
 #endif
 
 #if PLATFORM(WX)
@@ -182,10 +192,8 @@ namespace WebCore {
 
 #if PLATFORM(MAC)
         int m_eventNumber;
-#endif
-
-#if PLATFORM(WIN)
-        bool m_activatedWebView;
+#elif PLATFORM(WIN)
+        bool m_didActivateWebView;
 #endif
     };
 
diff --git a/WebCore/platform/win/PlatformMouseEventWin.cpp b/WebCore/platform/win/PlatformMouseEventWin.cpp
index 8b542f9..a1cf5aa 100644
--- a/WebCore/platform/win/PlatformMouseEventWin.cpp
+++ b/WebCore/platform/win/PlatformMouseEventWin.cpp
@@ -77,7 +77,7 @@ static MouseEventType messageToEventType(UINT message)
             return MouseEventMoved;
     }
 }
-PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool activatedWebView)
+PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool didActivateWebView)
     : m_position(positionForEvent(hWnd, lParam))
     , m_globalPosition(globalPositionForEvent(hWnd, lParam))
     , m_clickCount(0)
@@ -85,7 +85,7 @@ PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, L
     , m_ctrlKey(wParam & MK_CONTROL)
     , m_altKey(GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT)
     , m_metaKey(m_altKey) // FIXME: We'll have to test other browsers
-    , m_activatedWebView(activatedWebView)
+    , m_didActivateWebView(didActivateWebView)
     , m_eventType(messageToEventType(message))
     , m_modifierFlags(wParam)
 {
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 14ab88d..c1f4ca4 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,39 @@
+2011-01-04  Jeff Miller  <jeffm at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Mouse events in WebKit2 on Windows need to know whether the click activated the WebView to match WebKit1 behavior.
+        https://bugs.webkit.org/show_bug.cgi?id=51228
+
+        * Shared/WebEvent.h:
+        (WebKit::WebMouseEvent::didActivateWebView):
+        Add m_didActivateWebView to WebMouseEvent on Windows.
+
+        * Shared/WebEventConversion.cpp:
+        (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
+        Propagate whether the click activated the WebView when converting to a PlatformMouseEvent.
+
+        * Shared/WebMouseEvent.cpp:
+        (WebKit::WebMouseEvent::WebMouseEvent):
+        Add m_didActivateWebView to WebMouseEvent on Windows.
+
+        (WebKit::WebMouseEvent::encode):
+        (WebKit::WebMouseEvent::decode):
+        Encode and decode new m_didActivateWebView member variable.
+
+        * Shared/win/WebEventFactory.cpp:
+        (WebKit::WebEventFactory::createWebMouseEvent):
+        * Shared/win/WebEventFactory.h:
+        Add didActivateWebView parameter to createWebMouseEvent().
+
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::wndProc):
+        (WebKit::WebView::WebView):
+        (WebKit::WebView::onMouseEvent):
+        * UIProcess/win/WebView.h:
+        (WebKit::WebView::setWasActivatedByMouseEvent):
+        Keep track of whether the click activated the WebView.
+
 2011-01-04  Ivan Krstić  <ike at apple.com>
 
         Reviewed and landed by Anders Carlsson.
diff --git a/WebKit2/Shared/WebEvent.h b/WebKit2/Shared/WebEvent.h
index caee65f..b17cc38 100644
--- a/WebKit2/Shared/WebEvent.h
+++ b/WebKit2/Shared/WebEvent.h
@@ -110,6 +110,9 @@ public:
     WebMouseEvent() { }
 
     WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp);
+#if PLATFORM(WIN)
+    WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, bool didActivateWebView);
+#endif
 
     Button button() const { return static_cast<Button>(m_button); }
     const WebCore::IntPoint& position() const { return m_position; }
@@ -118,6 +121,9 @@ public:
     float deltaY() const { return m_deltaY; }
     float deltaZ() const { return m_deltaZ; }
     int32_t clickCount() const { return m_clickCount; }
+#if PLATFORM(WIN)
+    bool didActivateWebView() const { return m_didActivateWebView; }
+#endif
 
     void encode(CoreIPC::ArgumentEncoder*) const;
     static bool decode(CoreIPC::ArgumentDecoder*, WebMouseEvent&);
@@ -132,6 +138,9 @@ private:
     float m_deltaY;
     float m_deltaZ;
     int32_t m_clickCount;
+#if PLATFORM(WIN)
+    bool m_didActivateWebView;
+#endif
 };
 
 // FIXME: Move this class to its own header file.
diff --git a/WebKit2/Shared/WebEventConversion.cpp b/WebKit2/Shared/WebEventConversion.cpp
index 54d4b4c..69e197d 100644
--- a/WebKit2/Shared/WebEventConversion.cpp
+++ b/WebKit2/Shared/WebEventConversion.cpp
@@ -83,6 +83,10 @@ public:
             m_modifierFlags |= WebEvent::AltKey;
         if (m_metaKey)
             m_modifierFlags |= WebEvent::MetaKey;
+
+#if PLATFORM(WIN)
+        m_didActivateWebView = webEvent.didActivateWebView();
+#endif
     }
 };
 
diff --git a/WebKit2/Shared/WebMouseEvent.cpp b/WebKit2/Shared/WebMouseEvent.cpp
index 5bc12cd..fe30290 100644
--- a/WebKit2/Shared/WebMouseEvent.cpp
+++ b/WebKit2/Shared/WebMouseEvent.cpp
@@ -41,15 +41,39 @@ WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position,
     , m_deltaY(deltaY)
     , m_deltaZ(deltaZ)
     , m_clickCount(clickCount)
+#if PLATFORM(WIN)
+    , m_didActivateWebView(false)
+#endif
 {
     ASSERT(isMouseEventType(type));
 }
 
+#if PLATFORM(WIN)
+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, bool didActivateWebView)
+    : WebEvent(type, modifiers, timestamp)
+    , m_button(button)
+    , m_position(position)
+    , m_globalPosition(globalPosition)
+    , m_deltaX(deltaX)
+    , m_deltaY(deltaY)
+    , m_deltaZ(deltaZ)
+    , m_clickCount(clickCount)
+    , m_didActivateWebView(didActivateWebView)
+{
+    ASSERT(isMouseEventType(type));
+}
+#endif
+
 void WebMouseEvent::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
     WebEvent::encode(encoder);
 
+#if PLATFORM(WIN)
+    // Include m_didActivateWebView on Windows.
+    encoder->encode(CoreIPC::In(m_button, m_position, m_globalPosition, m_deltaX, m_deltaY, m_deltaZ, m_clickCount, m_didActivateWebView));
+#else
     encoder->encode(CoreIPC::In(m_button, m_position, m_globalPosition, m_deltaX, m_deltaY, m_deltaZ, m_clickCount));
+#endif
 }
 
 bool WebMouseEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebMouseEvent& t)
@@ -57,7 +81,12 @@ bool WebMouseEvent::decode(CoreIPC::ArgumentDecoder* decoder, WebMouseEvent& t)
     if (!WebEvent::decode(decoder, t))
         return false;
 
+#if PLATFORM(WIN)
+    // Include m_didActivateWebView on Windows.
+    return decoder->decode(CoreIPC::Out(t.m_button, t.m_position, t.m_globalPosition, t.m_deltaX, t.m_deltaY, t.m_deltaZ, t.m_clickCount, t.m_didActivateWebView));
+#else
     return decoder->decode(CoreIPC::Out(t.m_button, t.m_position, t.m_globalPosition, t.m_deltaX, t.m_deltaY, t.m_deltaZ, t.m_clickCount));
+#endif
 }
 
 bool WebMouseEvent::isMouseEventType(Type type)
diff --git a/WebKit2/Shared/win/WebEventFactory.cpp b/WebKit2/Shared/win/WebEventFactory.cpp
index 7789271..a4081fc 100644
--- a/WebKit2/Shared/win/WebEventFactory.cpp
+++ b/WebKit2/Shared/win/WebEventFactory.cpp
@@ -323,7 +323,7 @@ static String keyIdentifierFromEvent(WPARAM wparam, WebEvent::Type type)
     }
 }
 
-WebMouseEvent WebEventFactory::createWebMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+WebMouseEvent WebEventFactory::createWebMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool didActivateWebView)
 {
     WebEvent::Type type;
     WebMouseEvent::Button button = WebMouseEvent::NoButton;
@@ -391,7 +391,7 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(HWND hWnd, UINT message, WPAR
     int clickCount = WebKit::clickCount(type, button, position, timestamp);
     WebEvent::Modifiers modifiers = modifiersForEvent(wParam);
 
-    return WebMouseEvent(type, button, position, globalPosition, 0, 0, 0, clickCount, modifiers, timestamp);
+    return WebMouseEvent(type, button, position, globalPosition, 0, 0, 0, clickCount, modifiers, timestamp, didActivateWebView);
 }
 
 WebWheelEvent WebEventFactory::createWebWheelEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
diff --git a/WebKit2/Shared/win/WebEventFactory.h b/WebKit2/Shared/win/WebEventFactory.h
index 10a30fe..ce75cdf 100644
--- a/WebKit2/Shared/win/WebEventFactory.h
+++ b/WebKit2/Shared/win/WebEventFactory.h
@@ -35,9 +35,9 @@ namespace WebKit {
 
 class WebEventFactory {
 public:
-    static WebMouseEvent createWebMouseEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
-    static WebWheelEvent createWebWheelEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
-    static WebKeyboardEvent createWebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
+    static WebMouseEvent createWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool didActivateWebView);
+    static WebWheelEvent createWebWheelEvent(HWND, UINT message, WPARAM, LPARAM);
+    static WebKeyboardEvent createWebKeyboardEvent(HWND, UINT message, WPARAM, LPARAM);
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/win/WebView.cpp b/WebKit2/UIProcess/win/WebView.cpp
index 1530779..39f5049 100644
--- a/WebKit2/UIProcess/win/WebView.cpp
+++ b/WebKit2/UIProcess/win/WebView.cpp
@@ -116,6 +116,10 @@ LRESULT WebView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         case WM_PRINTCLIENT:
             lResult = onPrintClientEvent(hWnd, message, wParam, lParam, handled);
             break;
+        case WM_MOUSEACTIVATE:
+            setWasActivatedByMouseEvent(true);
+            handled = false;
+            break;
         case WM_MOUSEMOVE:
         case WM_LBUTTONDOWN:
         case WM_MBUTTONDOWN:
@@ -224,6 +228,7 @@ WebView::WebView(RECT rect, WebContext* context, WebPageGroup* pageGroup, HWND p
     , m_webCoreCursor(0)
     , m_overrideCursor(0)
     , m_trackingMouseLeave(false)
+    , m_wasActivatedByMouseEvent(false)
     , m_isBeingDestroyed(false)
     , m_inIMEComposition(0)
 {
@@ -317,6 +322,9 @@ void WebView::windowAncestryDidChange()
 
 LRESULT WebView::onMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled)
 {
+    WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(hWnd, message, wParam, lParam, m_wasActivatedByMouseEvent);
+    setWasActivatedByMouseEvent(false);
+    
     switch (message) {
         case WM_LBUTTONDOWN:
         case WM_MBUTTONDOWN:
@@ -343,7 +351,6 @@ LRESULT WebView::onMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
             ASSERT_NOT_REACHED();
     }
 
-    WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(hWnd, message, wParam, lParam);
     m_page->handleMouseEvent(mouseEvent);
 
     handled = true;
diff --git a/WebKit2/UIProcess/win/WebView.h b/WebKit2/UIProcess/win/WebView.h
index c7729e2..6041476 100644
--- a/WebKit2/UIProcess/win/WebView.h
+++ b/WebKit2/UIProcess/win/WebView.h
@@ -66,6 +66,7 @@ private:
     static LRESULT CALLBACK WebViewWndProc(HWND, UINT, WPARAM, LPARAM);
     LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
 
+    void setWasActivatedByMouseEvent(bool flag) { m_wasActivatedByMouseEvent = flag; }
     LRESULT onMouseEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled);
     LRESULT onWheelEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled);
     LRESULT onKeyEvent(HWND hWnd, UINT message, WPARAM, LPARAM, bool& handled);
@@ -145,6 +146,7 @@ private:
     HCURSOR m_webCoreCursor;
     HCURSOR m_overrideCursor;
 
+    bool m_wasActivatedByMouseEvent;
     bool m_trackingMouseLeave;
     bool m_isBeingDestroyed;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list