WebKit Bugzilla
Attachment 348026 Details for
Bug 188923
: Introduce _WKInspector
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188923-20180824112359.patch (text/plain), 20.15 KB, created by
Alex Christensen
on 2018-08-24 11:24:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-08-24 11:24:00 PDT
Size:
20.15 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 235259) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,40 @@ >+2018-08-24 Alex Christensen <achristensen@webkit.org> >+ >+ Introduce _WKInspector >+ https://bugs.webkit.org/show_bug.cgi?id=188923 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/Cocoa/APIObject.mm: >+ (API::Object::newObject): >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _inspector]): >+ * UIProcess/API/Cocoa/WKWebViewPrivate.h: >+ * UIProcess/API/Cocoa/_WKInspector.h: Added. >+ * UIProcess/API/Cocoa/_WKInspector.mm: Added. >+ (-[_WKInspector webView]): >+ (-[_WKInspector isConnected]): >+ (-[_WKInspector isVisible]): >+ (-[_WKInspector isFront]): >+ (-[_WKInspector isProfilingPage]): >+ (-[_WKInspector isElementSelectionActive]): >+ (-[_WKInspector connect]): >+ (-[_WKInspector show]): >+ (-[_WKInspector hide]): >+ (-[_WKInspector close]): >+ (-[_WKInspector showConsole]): >+ (-[_WKInspector showResources]): >+ (-[_WKInspector showMainResourceForFrame:]): >+ (-[_WKInspector attach]): >+ (-[_WKInspector detach]): >+ (-[_WKInspector showTimelines]): >+ (-[_WKInspector togglePageProfiling]): >+ (-[_WKInspector toggleElementSelection]): >+ (-[_WKInspector printErrorToConsole:]): >+ (-[_WKInspector _apiObject]): >+ * UIProcess/API/Cocoa/_WKInspectorInternal.h: Added. >+ * WebKit.xcodeproj/project.pbxproj: >+ > 2018-08-23 Alex Christensen <achristensen@webkit.org> > > Add new _webViewRequestPointerLock SPI with a completionHandler >Index: Source/WebKit/Shared/Cocoa/APIObject.mm >=================================================================== >--- Source/WebKit/Shared/Cocoa/APIObject.mm (revision 235156) >+++ Source/WebKit/Shared/Cocoa/APIObject.mm (working copy) >@@ -75,6 +75,7 @@ > #import "_WKFrameHandleInternal.h" > #import "_WKGeolocationPositionInternal.h" > #import "_WKHitTestResultInternal.h" >+#import "_WKInspectorInternal.h" > #import "_WKProcessPoolConfigurationInternal.h" > #import "_WKUserContentWorldInternal.h" > #import "_WKUserInitiatedActionInternal.h" >@@ -233,6 +234,10 @@ void* Object::newObject(size_t size, Typ > break; > #endif > >+ case Type::Inspector: >+ wrapper = [_WKInspector alloc]; >+ break; >+ > case Type::Navigation: > wrapper = [WKNavigation alloc]; > break; >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (revision 235156) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (working copy) >@@ -89,6 +89,7 @@ > #import "_WKFullscreenDelegate.h" > #import "_WKHitTestResultInternal.h" > #import "_WKInputDelegate.h" >+#import "_WKInspectorInternal.h" > #import "_WKRemoteObjectRegistryInternal.h" > #import "_WKSessionStateInternal.h" > #import "_WKVisitedLinkStoreInternal.h" >@@ -6442,6 +6443,13 @@ - (void)_setDefersLoadingForTesting:(BOO > _page->setDefersLoadingForTesting(defersLoading); > } > >+- (_WKInspector *)_inspector >+{ >+ if (auto* inspector = _page->inspector()) >+ return wrapper(*inspector); >+ return nil; >+} >+ > - (void)_denyNextUserMediaRequest > { > #if ENABLE(MEDIA_STREAM) >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (revision 235156) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (working copy) >@@ -101,6 +101,7 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEd > @class _WKFrameHandle; > @class _WKHitTestResult; > @class _WKIconLoadingDelegate; >+@class _WKInspector; > @class _WKRemoteObjectRegistry; > @class _WKSessionState; > @class _WKThumbnailView; >@@ -468,6 +469,8 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEd > - (BOOL)_completeBackSwipeForTesting; > - (void)_setDefersLoadingForTesting:(BOOL)defersLoading; > >+@property (nonatomic, readonly) _WKInspector *_inspector WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+ > @end > > #endif >Index: Source/WebKit/UIProcess/API/Cocoa/_WKInspector.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/_WKInspector.h (nonexistent) >+++ Source/WebKit/UIProcess/API/Cocoa/_WKInspector.h (working copy) >@@ -0,0 +1,66 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import <Foundation/Foundation.h> >+#import <WebKit/WKFoundation.h> >+ >+#if WK_API_ENABLED >+ >+@class WKWebView; >+@class _WKFrameHandle; >+ >+NS_ASSUME_NONNULL_BEGIN >+ >+WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)) >+@interface _WKInspector : NSObject >+ >+- (instancetype)init NS_UNAVAILABLE; >+ >+@property (nonatomic, readonly) WKWebView *webView; >+@property (nonatomic, readonly) BOOL isConnected; >+@property (nonatomic, readonly) BOOL isVisible; >+@property (nonatomic, readonly) BOOL isFront; >+@property (nonatomic, readonly) BOOL isProfilingPage; >+@property (nonatomic, readonly) BOOL isElementSelectionActive; >+ >+- (void)connect; >+- (void)show; >+- (void)hide; >+- (void)close; >+- (void)showConsole; >+- (void)showResources; >+- (void)showMainResourceForFrame:(_WKFrameHandle *)frame; >+- (void)attach; >+- (void)detach; >+- (void)showTimelines; >+- (void)togglePageProfiling; >+- (void)toggleElementSelection; >+- (void)printErrorToConsole:(NSString *)error; >+ >+@end >+ >+NS_ASSUME_NONNULL_END >+ >+#endif >Index: Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm (nonexistent) >+++ Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm (working copy) >@@ -0,0 +1,145 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "_WKInspector.h" >+ >+#if WK_API_ENABLED >+ >+#import "WKWebViewInternal.h" >+#import "WebProcessProxy.h" >+#import "_WKFrameHandleInternal.h" >+#import "_WKInspectorInternal.h" >+#import <wtf/RetainPtr.h> >+ >+@implementation _WKInspector >+ >+- (WKWebView *)webView >+{ >+ if (auto* page = _inspector->inspectedPage()) >+ return fromWebPageProxy(*page); >+ return nil; >+} >+ >+- (BOOL)isConnected >+{ >+ return _inspector->isConnected(); >+} >+ >+- (BOOL)isVisible >+{ >+ return _inspector->isVisible(); >+} >+ >+- (BOOL)isFront >+{ >+ return _inspector->isFront(); >+} >+ >+- (BOOL)isProfilingPage >+{ >+ return _inspector->isProfilingPage(); >+} >+ >+- (BOOL)isElementSelectionActive >+{ >+ return _inspector->isElementSelectionActive(); >+} >+ >+- (void)connect >+{ >+ _inspector->connect(); >+} >+ >+- (void)show >+{ >+ _inspector->show(); >+} >+ >+- (void)hide >+{ >+ _inspector->hide(); >+} >+ >+- (void)close >+{ >+ _inspector->close(); >+} >+ >+- (void)showConsole >+{ >+ _inspector->showConsole(); >+} >+ >+- (void)showResources >+{ >+ _inspector->showResources(); >+} >+ >+- (void)showMainResourceForFrame:(_WKFrameHandle *)frame >+{ >+ if (auto* page = _inspector->inspectedPage()) >+ _inspector->showMainResourceForFrame(page->process().webFrame(frame._frameID)); >+} >+ >+- (void)attach >+{ >+ _inspector->attach(); >+} >+ >+- (void)detach >+{ >+ _inspector->detach(); >+} >+ >+- (void)showTimelines >+{ >+ _inspector->showTimelines(); >+} >+ >+- (void)togglePageProfiling >+{ >+ _inspector->togglePageProfiling(); >+} >+ >+- (void)toggleElementSelection >+{ >+ _inspector->toggleElementSelection(); >+} >+ >+- (void)printErrorToConsole:(NSString *)error >+{ >+ // FIXME: This should use a new message source rdar://problem/34658378 >+ [[self webView] evaluateJavaScript:[NSString stringWithFormat:@"console.error(\"%@\");", error] completionHandler:nil]; >+} >+ >+- (API::Object&)_apiObject >+{ >+ return *_inspector; >+} >+ >+@end >+ >+#endif >Index: Source/WebKit/UIProcess/API/Cocoa/_WKInspectorInternal.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/_WKInspectorInternal.h (nonexistent) >+++ Source/WebKit/UIProcess/API/Cocoa/_WKInspectorInternal.h (working copy) >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "_WKInspector.h" >+ >+#if WK_API_ENABLED >+ >+#import "WKObject.h" >+#import "WebInspectorProxy.h" >+ >+namespace WebKit { >+ >+template<> struct WrapperTraits<WebInspectorProxy> { >+ using WrapperClass = _WKInspector; >+}; >+ >+} >+ >+@interface _WKInspector () <WKObject> { >+@package >+ API::ObjectStorage<WebKit::WebInspectorProxy> _inspector; >+} >+@end >+ >+#endif // WK_API_ENABLED >Index: Source/WebKit/WebKit.xcodeproj/project.pbxproj >=================================================================== >--- Source/WebKit/WebKit.xcodeproj/project.pbxproj (revision 235321) >+++ Source/WebKit/WebKit.xcodeproj/project.pbxproj (working copy) >@@ -1165,6 +1165,9 @@ > 5C9E56821DF7F1AB00C9EE33 /* WKWebsitePolicies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C9E56801DF7F05500C9EE33 /* WKWebsitePolicies.cpp */; }; > 5C9E56831DF7F1B300C9EE33 /* WKWebsitePolicies.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9E56811DF7F05500C9EE33 /* WKWebsitePolicies.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5CA9854A210BEB640057EB6B /* SafeBrowsingResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CA98549210BEB5A0057EB6B /* SafeBrowsingResult.h */; }; >+ 5CAFDE452130846300B1F7E1 /* _WKInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE422130843500B1F7E1 /* _WKInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 5CAFDE462130846800B1F7E1 /* _WKInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CAFDE432130843600B1F7E1 /* _WKInspector.mm */; }; >+ 5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */; }; > 5CB2378B1DF0DE5300117AA3 /* _WKWebsitePolicies.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB2378A1DF0DD4300117AA3 /* _WKWebsitePolicies.mm */; }; > 5CB2378C1DF0DE6E00117AA3 /* _WKWebsitePolicies.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB237891DF0DD4300117AA3 /* _WKWebsitePolicies.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5CB2378E1DF0E0D300117AA3 /* _WKWebsitePoliciesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB2378D1DF0E0C200117AA3 /* _WKWebsitePoliciesInternal.h */; }; >@@ -3651,6 +3654,9 @@ > 5C9E56811DF7F05500C9EE33 /* WKWebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebsitePolicies.h; sourceTree = "<group>"; }; > 5CA98549210BEB5A0057EB6B /* SafeBrowsingResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SafeBrowsingResult.h; sourceTree = "<group>"; }; > 5CA9854B210BEB730057EB6B /* SafeBrowsingResultCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SafeBrowsingResultCocoa.mm; sourceTree = "<group>"; }; >+ 5CAFDE422130843500B1F7E1 /* _WKInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKInspector.h; sourceTree = "<group>"; }; >+ 5CAFDE432130843600B1F7E1 /* _WKInspector.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKInspector.mm; sourceTree = "<group>"; }; >+ 5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKInspectorInternal.h; sourceTree = "<group>"; }; > 5CB237891DF0DD4300117AA3 /* _WKWebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsitePolicies.h; sourceTree = "<group>"; }; > 5CB2378A1DF0DD4300117AA3 /* _WKWebsitePolicies.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKWebsitePolicies.mm; sourceTree = "<group>"; }; > 5CB2378D1DF0E0C200117AA3 /* _WKWebsitePoliciesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsitePoliciesInternal.h; sourceTree = "<group>"; }; >@@ -6156,6 +6162,9 @@ > 63C32C271E98119000699BD0 /* _WKGeolocationPositionInternal.h */, > 5143B25E1DDCDFD10014FAC6 /* _WKIconLoadingDelegate.h */, > 37A64E5418F38E3C00EB30F1 /* _WKInputDelegate.h */, >+ 5CAFDE422130843500B1F7E1 /* _WKInspector.h */, >+ 5CAFDE432130843600B1F7E1 /* _WKInspector.mm */, >+ 5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */, > 2D790A9C1AD7050D00AB90B3 /* _WKLayoutMode.h */, > 51C0C9791DDD78540032CAD3 /* _WKLinkIconParameters.h */, > 51C0C97A1DDD78540032CAD3 /* _WKLinkIconParameters.mm */, >@@ -8939,6 +8948,8 @@ > 93A88B3B1BC710D900ABA5C2 /* _WKHitTestResultInternal.h in Headers */, > 510F59101DDE296900412FF5 /* _WKIconLoadingDelegate.h in Headers */, > 37A64E5518F38E3C00EB30F1 /* _WKInputDelegate.h in Headers */, >+ 5CAFDE452130846300B1F7E1 /* _WKInspector.h in Headers */, >+ 5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */, > 2D790A9D1AD7050D00AB90B3 /* _WKLayoutMode.h in Headers */, > 510F59111DDE297000412FF5 /* _WKLinkIconParameters.h in Headers */, > A118A9F31908B8EA00F7C92B /* _WKNSFileManagerExtras.h in Headers */, >@@ -10847,6 +10858,7 @@ > 373D122218A473010066D9CC /* _WKFrameHandle.mm in Sources */, > 63C32C251E9810D900699BD0 /* _WKGeolocationPosition.mm in Sources */, > 93A88B391BC70F3F00ABA5C2 /* _WKHitTestResult.mm in Sources */, >+ 5CAFDE462130846800B1F7E1 /* _WKInspector.mm in Sources */, > 510F59121DDE297700412FF5 /* _WKLinkIconParameters.mm in Sources */, > A118A9F21908B8EA00F7C92B /* _WKNSFileManagerExtras.mm in Sources */, > A5C0F0A82000655100536536 /* _WKNSWindowExtras.mm in Sources */, >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 235321) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,14 @@ >+2018-08-24 Alex Christensen <achristensen@webkit.org> >+ >+ Introduce _WKInspector >+ https://bugs.webkit.org/show_bug.cgi?id=188923 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * MiniBrowser/mac/WK2BrowserWindowController.m: >+ (-[WK2BrowserWindowController validateMenuItem:]): >+ (-[WK2BrowserWindowController showHideWebInspector:]): >+ > 2018-08-24 Jonathan Bedard <jbedard@apple.com> > > Fix handling of iOS minor versions in default_baseline_search_path >Index: Tools/MiniBrowser/mac/WK2BrowserWindowController.m >=================================================================== >--- Tools/MiniBrowser/mac/WK2BrowserWindowController.m (revision 235156) >+++ Tools/MiniBrowser/mac/WK2BrowserWindowController.m (working copy) >@@ -31,7 +31,6 @@ > #import "AppKitCompatibilityDeclarations.h" > #import "SettingsController.h" > #import <WebKit/WKFrameInfo.h> >-#import <WebKit/WKInspector.h> > #import <WebKit/WKNavigationActionPrivate.h> > #import <WebKit/WKNavigationDelegate.h> > #import <WebKit/WKPage.h> >@@ -43,6 +42,7 @@ > #import <WebKit/WKWebsiteDataStorePrivate.h> > #import <WebKit/WebNSURLExtras.h> > #import <WebKit/_WKIconLoadingDelegate.h> >+#import <WebKit/_WKInspector.h> > #import <WebKit/_WKLinkIconParameters.h> > #import <WebKit/_WKUserInitiatedAction.h> > >@@ -209,7 +209,7 @@ - (BOOL)validateMenuItem:(NSMenuItem *)m > else if (action == @selector(toggleEditable:)) > [menuItem setState:self.isEditable ? NSControlStateValueOn : NSControlStateValueOff]; > else if (action == @selector(showHideWebInspector:)) >- [menuItem setTitle:WKInspectorIsVisible(WKPageGetInspector(_webView._pageRefForTransitionToWKWebView)) ? @"Close Web Inspector" : @"Show Web Inspector"]; >+ [menuItem setTitle:_webView._inspector.isVisible ? @"Close Web Inspector" : @"Show Web Inspector"]; > else if (action == @selector(toggleAlwaysShowsHorizontalScroller:)) > menuItem.state = _webView._alwaysShowsHorizontalScroller ? NSControlStateValueOn : NSControlStateValueOff; > else if (action == @selector(toggleAlwaysShowsVerticalScroller:)) >@@ -289,11 +289,11 @@ - (IBAction)dumpSourceToConsole:(id)send > > - (IBAction)showHideWebInspector:(id)sender > { >- WKInspectorRef inspectorRef = WKPageGetInspector(_webView._pageRefForTransitionToWKWebView); >- if (WKInspectorIsVisible(inspectorRef)) >- WKInspectorHide(inspectorRef); >+ _WKInspector *inspector = _webView._inspector; >+ if (inspector.isVisible) >+ [inspector hide]; > else >- WKInspectorShow(inspectorRef); >+ [inspector show]; > } > > - (IBAction)toggleAlwaysShowsHorizontalScroller:(id)sender
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188923
:
348025
| 348026