WebCore shouldn't have a Objective-C class named NSCursor
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2018 21:54:20 +0000 (21:54 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Dec 2018 21:54:20 +0000 (21:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192602
<rdar://problem/46615532>

Reviewed by Wenson Hsieh.

Source/WebCore:

* platform/ios/wak/WAKAppKitStubs.h:
* platform/ios/wak/WAKAppKitStubs.m:
(+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
Get rid of the class.
Also remove a comment that seems to have detached from wherever it's supposed to be.

Source/WebKitLegacy/mac:

* WebView/WebFrameView.mm:
(-[WebFrameView keyDown:keyDown:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView keyDown:]):
(-[WebHTMLView performKeyEquivalent:]):
Only use NSCursor on macOS.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/wak/WAKAppKitStubs.h
Source/WebCore/platform/ios/wak/WAKAppKitStubs.m
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebFrameView.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm

index e12b9ed..5c6b219 100644 (file)
@@ -1,3 +1,17 @@
+2018-12-11  Tim Horton  <timothy_horton@apple.com>
+
+        WebCore shouldn't have a Objective-C class named NSCursor
+        https://bugs.webkit.org/show_bug.cgi?id=192602
+        <rdar://problem/46615532>
+
+        Reviewed by Wenson Hsieh.
+
+        * platform/ios/wak/WAKAppKitStubs.h:
+        * platform/ios/wak/WAKAppKitStubs.m:
+        (+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
+        Get rid of the class.
+        Also remove a comment that seems to have detached from wherever it's supposed to be.
+
 2018-12-11  Chris Dumez  <cdumez@apple.com>
 
         Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
index 41048d7..24f8f39 100644 (file)
@@ -23,8 +23,6 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* Unicodes we reserve for function keys on the keyboard,  OpenStep reserves the range 0xF700-0xF8FF for this purpose.  The availability of various keys will be system dependent. */
-
 #ifndef WAKAppKitStubs_h
 #define WAKAppKitStubs_h
 
@@ -205,10 +203,6 @@ typedef enum _NSSelectionDirection {
     NSSelectingPrevious
 } NSSelectionDirection;
 
-WEBCORE_EXPORT @interface NSCursor : NSObject
-+ (void)setHiddenUntilMouseMoves:(BOOL)flag;
-@end
-
 #endif // TARGET_OS_IPHONE
 
 #endif // WAKAppKitStubs_h
index caffcc6..bf1193f 100644 (file)
 
 id NSApp = nil;
 
-@implementation NSCursor
-+ (void)setHiddenUntilMouseMoves:(BOOL)flag
-{
-    UNUSED_PARAM(flag);
-}
-@end
-
 #endif // PLATFORM(IOS_FAMILY)
index f9a8e54..2149c53 100644 (file)
@@ -1,3 +1,18 @@
+2018-12-11  Tim Horton  <timothy_horton@apple.com>
+
+        WebCore shouldn't have a Objective-C class named NSCursor
+        https://bugs.webkit.org/show_bug.cgi?id=192602
+        <rdar://problem/46615532>
+
+        Reviewed by Wenson Hsieh.
+
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView keyDown:keyDown:]):
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView keyDown:]):
+        (-[WebHTMLView performKeyEquivalent:]):
+        Only use NSCursor on macOS.
+
 2018-12-10  Don Olmstead  <don.olmstead@sony.com>
 
         Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
index 56266cf..41c5379 100644 (file)
@@ -1087,8 +1087,10 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     if (callSuper) {
         [super keyDown:event];
     } else {
-        // if we did something useful, get the cursor out of the way
+#if PLATFORM(MAC)
+        // If we did something useful, get the cursor out of the way.
         [NSCursor setHiddenUntilMouseMoves:YES];
+#endif
     }
 }
 
index 887d8fb..f05c7be 100644 (file)
@@ -4976,8 +4976,11 @@ static RefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
 
     if (callSuper)
         [super keyDown:event];
-    else
+    else {
+#if PLATFORM(MAC)
         [NSCursor setHiddenUntilMouseMoves:YES];
+#endif
+    }
 }
 
 - (void)keyUp:(WebEvent *)event
@@ -5281,9 +5284,11 @@ IGNORE_WARNINGS_END
         if (Frame* frame = core([self _frame]))
             ret = frame->eventHandler().keyEvent(event);
 
-    if (ret)
+    if (ret) {
+#if PLATFORM(MAC)
         [NSCursor setHiddenUntilMouseMoves:YES];
-    else
+#endif
+    } else
         ret = [self _handleStyleKeyEquivalent:event] || [super performKeyEquivalent:event];
 
     [self release];