Bug 233018

Summary: WebKit should pipe mouse hover events on iOS to the UI delegate
Product: WebKit Reporter: Kevin Turner <kevinturner>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, kevin_turner, simon.fraser, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Simple test case example
none
Patch
none
Patch
none
Patch none

Description Kevin Turner 2021-11-11 15:20:41 PST
WebKit should allow `mouseDidMoveOverElement` delegate callbacks on iOS. These callbacks are currently guarded to be macOS only in WKUIDelegatePrivate.h.
Comment 1 Radar WebKit Bug Importer 2021-11-11 15:22:13 PST
<rdar://problem/85318451>
Comment 2 Simon Fraser (smfr) 2021-11-12 17:33:08 PST
Do you have a reason for wanting them?
Comment 3 Kevin Turner 2022-02-09 18:25:05 PST
Created attachment 451476 [details]
Patch
Comment 4 Wenson Hsieh 2022-02-09 18:27:50 PST
We should be able to write a quick API test to exercise this codepath.
Comment 5 Darin Adler 2022-02-09 18:55:10 PST
Comment on attachment 451476 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451476&action=review

> Source/WebKit/Shared/API/Cocoa/_WKHitTestResult.h:28
> +#if PLATFORM(MAC) || HAVE(UIKIT_WITH_MOUSE_SUPPORT)

This header is used outside WebKIt, and thus it can’t use PLATFORM() and HAVE() includes.
Comment 6 Darin Adler 2022-02-09 18:55:29 PST
Comment on attachment 451476 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451476&action=review

>> Source/WebKit/Shared/API/Cocoa/_WKHitTestResult.h:28
>> +#if PLATFORM(MAC) || HAVE(UIKIT_WITH_MOUSE_SUPPORT)
> 
> This header is used outside WebKIt, and thus it can’t use PLATFORM() and HAVE() includes.

Can’t use PLATFORM() and HAVE() macros.
Comment 7 Kevin Turner 2022-02-09 18:58:33 PST
Created attachment 451480 [details]
Patch
Comment 8 Wenson Hsieh 2022-02-09 23:14:28 PST
Created attachment 451495 [details]
Simple test case example

(Example of an API test case that could be used to exercise the new API on iOS)
Comment 9 Tim Horton 2022-02-09 23:15:49 PST
Comment on attachment 451480 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451480&action=review

> Source/WebKit/Shared/API/Cocoa/_WKHitTestResult.h:28
> +#if TARGET_OS_OSX || TARGET_OS_IPHONE

I'm pretty sure this condition is true everywhere that this file exists (IPHONE includes all of the iOS-derivatives), so maybe you can just delete it instead? Or maybe you meant TARGET_OS_IOS

> Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:74
> +#if !PLATFORM(MAC)

Why the inverted condition? Should be PLATFORM(IOS_FAMILY) or maybe the HAVE
Comment 10 Tim Horton 2022-02-09 23:16:15 PST
(and yes, a test would be lovely)
Comment 11 Kevin Turner 2022-02-10 18:57:20 PST
Created attachment 451628 [details]
Patch
Comment 12 Wenson Hsieh 2022-02-11 17:37:16 PST
Comment on attachment 451628 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451628&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm:356
> +    EXPECT_TRUE(hitTestResult != nullptr);

Nit - ideally, this would be `EXPECT_NOT_NULL(hitTestResult);`
Comment 13 Kevin Turner 2022-02-11 17:41:42 PST
Created attachment 451763 [details]
Patch
Comment 14 Kevin Turner 2022-02-11 18:05:46 PST
Created attachment 451765 [details]
Patch
Comment 15 EWS 2022-02-12 07:43:22 PST
Committed r289694 (247179@main): <https://commits.webkit.org/247179@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 451765 [details].