https://bugs.webkit.org/show_bug.cgi?id=132038
Reviewed by Alexey Proskuryakov.
Source/WebCore:
r147739 incorrectly added an early exit in EventHandler::selectCursor when hit test result didn't have
any node associated with it. Since we will hit this code when the cursor is outside of the WebView,
we still need to take the CURSOR_AUTO path as did the code before r147739.
No new test is added since this behavior can't be tested in DRT or WTR.
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
Source/WebKit/mac:
Since the cursor type is now updated asynchronously after r147739,
[window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
evalutes to false depending on how fast cursor is moving.
Instead, check whether the NSWindow of the WebView is the key window or not since
key window appears to control the cursor style in Cocoa as far as I've tested:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::setCursor):
Source/WebKit2:
Since the cursor type is now updated asynchronously after r147739,
[window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
evalutes to false depending on how fast cursor is moving.
Instead, check whether the NSWindow of the WebView is the key window or not since
key window appears to control the cursor style in Cocoa as far as I've tested:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setCursor):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167700
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-04-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Cursor doesn't change back to pointer when leaving the Safari window
+ https://bugs.webkit.org/show_bug.cgi?id=132038
+
+ Reviewed by Alexey Proskuryakov.
+
+ r147739 incorrectly added an early exit in EventHandler::selectCursor when hit test result didn't have
+ any node associated with it. Since we will hit this code when the cursor is outside of the WebView,
+ we still need to take the CURSOR_AUTO path as did the code before r147739.
+
+ No new test is added since this behavior can't be tested in DRT or WTR.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::selectCursor):
+
2014-04-22 Zalan Bujtas <zalan@apple.com>
Do not paint border image when the border rect is empty.
#endif
Node* node = result.targetNode();
- if (!node)
- return NoCursorChange;
-
- auto renderer = node->renderer();
+ auto renderer = node ? node->renderer() : 0;
RenderStyle* style = renderer ? &renderer->style() : nullptr;
bool horizontalText = !style || style->isHorizontalWritingMode();
const Cursor& iBeam = horizontalText ? iBeamCursor() : verticalTextCursor();
switch (style ? style->cursor() : CURSOR_AUTO) {
case CURSOR_AUTO: {
- bool editable = node->hasEditableStyle();
+ bool editable = node && node->hasEditableStyle();
if (useHandCursor(node, result.isOverLink(), shiftKey))
return handCursor();
+2014-04-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Cursor doesn't change back to pointer when leaving the Safari window
+ https://bugs.webkit.org/show_bug.cgi?id=132038
+
+ Reviewed by Alexey Proskuryakov.
+
+ Since the cursor type is now updated asynchronously after r147739,
+ [window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
+ evalutes to false depending on how fast cursor is moving.
+
+ Instead, check whether the NSWindow of the WebView is the key window or not since
+ key window appears to control the cursor style in Cocoa as far as I've tested:
+ https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
+
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::setCursor):
+
2014-04-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r167674.
return;
NSWindow *window = [m_webView window];
- if (!window)
- return;
-
- if ([window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0])
+ if (!window || ![window isKeyWindow])
return;
NSCursor *platformCursor = cursor.platformCursor();
+2014-04-22 Ryosuke Niwa <rniwa@webkit.org>
+
+ Cursor doesn't change back to pointer when leaving the Safari window
+ https://bugs.webkit.org/show_bug.cgi?id=132038
+
+ Reviewed by Alexey Proskuryakov.
+
+ Since the cursor type is now updated asynchronously after r147739,
+ [window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0]
+ evalutes to false depending on how fast cursor is moving.
+
+ Instead, check whether the NSWindow of the WebView is the key window or not since
+ key window appears to control the cursor style in Cocoa as far as I've tested:
+ https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
+
+ * UIProcess/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::setCursor):
+
2014-04-22 Yongjun Zhang <yongjun_zhang@apple.com>
Add SPI to expose provisional URL from Frame.
return;
NSWindow *window = [m_wkView window];
- if (!window)
- return;
-
- if ([window windowNumber] != [NSWindow windowNumberAtPoint:[NSEvent mouseLocation] belowWindowWithWindowNumber:0])
+ if (!window || ![window isKeyWindow])
return;
NSCursor *platformCursor = cursor.platformCursor();