Skip to content

Commit c076957

Browse files
committed
Web Inspector: inspectable API doesn't have a correct Objective-C getter
https://bugs.webkit.org/show_bug.cgi?id=251702 rdar://105012093 Reviewed by Tim Horton. Boolean getters should have an `is` prefix. Currently `inspectable` is not adhering to this rule. The current getter also doesn't match the approved API design. This API has not yet shipped, and there is no internal usage of `[webView inspectable]`, so this change will not break existing clients. `webView.inspectable` remains correct and unchanged. * Source/JavaScriptCore/API/JSContext.h: * Source/JavaScriptCore/API/JSContext.mm: (-[JSContext isInspectable]): (-[JSContext inspectable]): Deleted. * Source/WebKit/UIProcess/API/Cocoa/WKWebView.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView isInspectable]): (-[WKWebView inspectable]): Deleted. Canonical link: https://commits.webkit.org/259840@main
1 parent 5e1033a commit c076957

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎Source/JavaScriptCore/API/JSContext.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ JSC_CLASS_AVAILABLE(macos(10.9), ios(7.0))
179179
@property
180180
@discussion Controls whether this @link JSContext @/link is inspectable in Web Inspector. The default value is NO.
181181
*/
182-
@property (nonatomic, setter=setInspectable:) BOOL inspectable JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA)) NS_SWIFT_NAME(isInspectable);
182+
@property (nonatomic, getter=isInspectable) BOOL inspectable JSC_API_AVAILABLE(macos(JSC_MAC_TBA), ios(JSC_IOS_TBA)) NS_SWIFT_NAME(isInspectable);
183183

184184
@end
185185

‎Source/JavaScriptCore/API/JSContext.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ - (void)setName:(NSString *)name
273273
JSGlobalContextSetName(m_context, OpaqueJSString::tryCreate(name).get());
274274
}
275275

276-
- (BOOL)inspectable
276+
- (BOOL)isInspectable
277277
{
278278
return JSGlobalContextIsInspectable(m_context);
279279
}

‎Source/WebKit/UIProcess/API/Cocoa/WKWebView.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ The uniform type identifier kUTTypeWebArchive can be used get the related pasteb
662662
@abstract Controls whether this @link WKWebView @/link is inspectable in Web Inspector.
663663
@discussion The default value is NO.
664664
*/
665-
@property (nonatomic, setter=setInspectable:) BOOL inspectable NS_SWIFT_NAME(isInspectable) WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
665+
@property (nonatomic, getter=isInspectable) BOOL inspectable NS_SWIFT_NAME(isInspectable) WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
666666

667667
@end
668668

‎Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ - (void)setInteractionState:(id)interactionState
14361436
_page->restoreFromSessionState(sessionState, true);
14371437
}
14381438

1439-
- (BOOL)inspectable
1439+
- (BOOL)isInspectable
14401440
{
14411441
#if ENABLE(REMOTE_INSPECTOR)
14421442
// FIXME: <http://webkit.org/b/246237> Local inspection should be controlled by `inspectable` API.

0 commit comments

Comments
 (0)