Bug 204300 - [Cocoa] Add WKUIDelegate SPI to inform clients when a _WKInspector attaches to a WKWebView
Summary: [Cocoa] Add WKUIDelegate SPI to inform clients when a _WKInspector attaches t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-18 09:46 PST by BJ Burg
Modified: 2022-03-01 02:27 PST (History)
7 users (show)

See Also:


Attachments
Patch (11.92 KB, patch)
2019-11-18 16:07 PST, BJ Burg
hi: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2019-11-18 09:46:18 PST
,
Comment 1 BJ Burg 2019-11-18 09:47:50 PST
<rdar://problem/57136993>
Comment 2 BJ Burg 2019-11-18 16:07:24 PST
Created attachment 383799 [details]
Patch
Comment 3 Devin Rousso 2019-11-18 17:10:36 PST
Comment on attachment 383799 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:240
> +- (void)_webView:(WKWebView *)webView didAttachInspector:(_WKInspector *)inspector WK_API_AVAILABLE(macos(WK_MAC_TBA));
> +#endif // !TARGET_OS_IPHONE

Wouldn't it be more accurate to have this be in its own `#if TARGET_OS_MAC`?
Comment 4 Joseph Pecoraro 2019-11-18 17:32:08 PST
(In reply to Devin Rousso from comment #3)
> Comment on attachment 383799 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=383799&action=review
> 
> r=me
> 
> > Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:240
> > +- (void)_webView:(WKWebView *)webView didAttachInspector:(_WKInspector *)inspector WK_API_AVAILABLE(macos(WK_MAC_TBA));
> > +#endif // !TARGET_OS_IPHONE
> 
> Wouldn't it be more accurate to have this be in its own `#if TARGET_OS_MAC`?

• TARGET_OS_MAC is more like DARWIN, it includes "everything" macOS, iOS, tvOS, watchOS etc
• TARGET_OS_IPHONE is more like IOS_FAMILY or EMBEDDED for us. It includes iOS, tvOS, watchOS, etc.

TARGET_OS_OSX is the thing that only targets directly macOS, however we don't use that anywhere in WebKit yet (I assume for compatibility when building on older OSes). The norm in WebKit is to use !TARGET_OS_IPHONE right now.
Comment 5 BJ Burg 2019-11-19 09:11:56 PST
Committed r252634: <https://trac.webkit.org/changeset/252634>