Title: [136222] trunk/Source/WebKit/chromium
Revision
136222
Author
[email protected]
Date
2012-11-30 03:21:25 -0800 (Fri, 30 Nov 2012)

Log Message

[Chromium] Page popup doesn't change mouse cursor
https://bugs.webkit.org/show_bug.cgi?id=97454

Reviewed by Kent Tamura.

The mouse cursor should change based on the page popup content and not the main window content.
On Mac the mousemove event propagates to both the page popup and main window causing the cursor to flicker.
The change to ChromeClientImpl stops that.

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::setCursor): On Mac, don't update the mouse cursor if a popup is open.
* src/WebPagePopupImpl.cpp: Implement setCursor so the mouse cursor gets set based on the page popup content.

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (136221 => 136222)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-11-30 10:56:16 UTC (rev 136221)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-11-30 11:21:25 UTC (rev 136222)
@@ -1,3 +1,18 @@
+2012-11-30  Keishi Hattori  <[email protected]>
+
+        [Chromium] Page popup doesn't change mouse cursor
+        https://bugs.webkit.org/show_bug.cgi?id=97454
+
+        Reviewed by Kent Tamura.
+
+        The mouse cursor should change based on the page popup content and not the main window content.
+        On Mac the mousemove event propagates to both the page popup and main window causing the cursor to flicker.
+        The change to ChromeClientImpl stops that.
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::setCursor): On Mac, don't update the mouse cursor if a popup is open.
+        * src/WebPagePopupImpl.cpp: Implement setCursor so the mouse cursor gets set based on the page popup content.
+
 2012-11-30  Mihai Maerean  <[email protected]>
 
         [CSSRegions] when WebKit uses V8, there should be a single variable to store if the CSS Regions feature is enabled

Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (136221 => 136222)


--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2012-11-30 10:56:16 UTC (rev 136221)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2012-11-30 11:21:25 UTC (rev 136222)
@@ -825,6 +825,12 @@
 
 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor)
 {
+#if OS(DARWIN)
+    // On Mac the mousemove event propagates to both the popup and main window.
+    // If a popup is open we don't want the main window to change the cursor.
+    if (m_webView->hasOpenedPopup())
+        return;
+#endif
     if (m_webView->client())
         m_webView->client()->didChangeCursor(cursor);
 }

Modified: trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp (136221 => 136222)


--- trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp	2012-11-30 10:56:16 UTC (rev 136221)
+++ trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp	2012-11-30 11:21:25 UTC (rev 136222)
@@ -42,6 +42,7 @@
 #include "PagePopupClient.h"
 #include "PageWidgetDelegate.h"
 #include "Settings.h"
+#include "WebCursorInfo.h"
 #include "WebInputEventConversion.h"
 #include "WebPagePopup.h"
 #include "WebSettingsImpl.h"
@@ -131,6 +132,12 @@
         return PlatformPageClient(this);
     }
 
+    virtual void setCursor(const WebCore::Cursor& cursor) OVERRIDE
+    {
+        if (m_popup->m_webView->client())
+            m_popup->m_webView->client()->didChangeCursor(WebCursorInfo(cursor));
+    }
+
     // PageClientChromium methods:
     virtual WebKit::WebScreenInfo screenInfo() OVERRIDE
     {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to