Changeset 259512 in webkit
- Timestamp:
- Apr 3, 2020 1:55:39 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r259483 r259512 1 2020-04-03 Tim Horton <timothy_horton@apple.com> 2 3 Add a visual debug indicator for locating and identifying all kinds of WebViews 4 https://bugs.webkit.org/show_bug.cgi?id=209982 5 <rdar://problem/60339870> 6 7 Reviewed by Simon Fraser. 8 9 Add a debug overlay that can be enabled with a single switch for all 10 *WebView variants, which indicates the type of *WebView in an unmissable, 11 gaudy fashion. 12 13 This is intended to address some shortcomings of existing mechanisms 14 that people use to answer the "what kind of web view is X app using?" 15 question. Specifically: 16 17 - it will appear even if the Web Content process does not launch or crashes 18 - it will appear even if a custom content view is being used (e.g. PDF) 19 - it will appear even if compositing is not enabled (e.g. in a legacy WebView on macOS) 20 - it explicitly states in written text the class name of the web view, with no need for interpreting colors 21 - it covers the entire web view, so cannot be accidentally obscured 22 23 No new tests, just debugging UI. 24 25 * SourcesCocoa.txt: 26 * WebCore.xcodeproj/project.pbxproj: 27 * testing/cocoa/WebViewVisualIdentificationOverlay.h: Added. 28 * testing/cocoa/WebViewVisualIdentificationOverlay.mm: Added. 29 (+[WebViewVisualIdentificationOverlay shouldIdentifyWebViews]): 30 Use a single default across all kinds of WebViews, instead of using 31 WebPreferences and friends, in order to make it extremely easy to turn on, 32 and because it's intended to be set globally, and is not useful on a 33 per-view basis. 34 35 (+[WebViewVisualIdentificationOverlay installForWebViewIfNeeded:kind:deprecated:]): 36 (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): 37 (-[WebViewVisualIdentificationOverlay dealloc]): 38 (-[WebViewVisualIdentificationOverlay observeValueForKeyPath:ofObject:change:context:]): 39 (-[WebViewVisualIdentificationOverlay drawLayer:inContext:]): 40 Draw a wash and the class name over the entire face of the web view. 41 The wash is blue for WKWebView and red for all of the deprecated web views (WKView, WebView, UIWebView). 42 1 43 2020-04-03 David Kilzer <ddkilzer@apple.com> 2 44 -
trunk/Source/WebCore/SourcesCocoa.txt
r258966 r259512 579 579 platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp 580 580 581 testing/cocoa/WebViewVisualIdentificationOverlay.mm 582 581 583 // Derived Sources 582 584 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r259435 r259512 753 753 2D70BA1318074DDF0001908A /* PlatformCALayerCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D70BA1218074DDF0001908A /* PlatformCALayerCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; }; 754 754 2D76BB821945632400CFD29A /* RunLoopObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D76BB801945632400CFD29A /* RunLoopObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 755 2D7DA0F22435EB1900F048D1 /* WebViewVisualIdentificationOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D7DA0EF2435EB1700F048D1 /* WebViewVisualIdentificationOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; }; 755 756 2D7ED0AB1BAE99170043B3E5 /* TimerEventBasedMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D7ED0A91BAE99170043B3E5 /* TimerEventBasedMock.h */; }; 756 757 2D81E1CF21A78CC200A32CF4 /* InsertEditableImageCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D81E1CD21A78CC200A32CF4 /* InsertEditableImageCommand.h */; }; … … 6860 6861 2D76BB801945632400CFD29A /* RunLoopObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoopObserver.h; sourceTree = "<group>"; }; 6861 6862 2D76BB8319456F8100CFD29A /* RunLoopObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoopObserver.cpp; sourceTree = "<group>"; }; 6863 2D7DA0EF2435EB1700F048D1 /* WebViewVisualIdentificationOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewVisualIdentificationOverlay.h; sourceTree = "<group>"; }; 6864 2D7DA0F12435EB1800F048D1 /* WebViewVisualIdentificationOverlay.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewVisualIdentificationOverlay.mm; sourceTree = "<group>"; }; 6862 6865 2D7ED0A91BAE99170043B3E5 /* TimerEventBasedMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimerEventBasedMock.h; sourceTree = "<group>"; }; 6863 6866 2D81E1CB21A78CC100A32CF4 /* InsertEditableImageCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InsertEditableImageCommand.cpp; sourceTree = "<group>"; }; … … 22956 22959 A1763F3D1E205234001D58DE /* WebArchiveDumpSupport.h */, 22957 22960 A1763F3C1E205234001D58DE /* WebArchiveDumpSupport.mm */, 22961 2D7DA0EF2435EB1700F048D1 /* WebViewVisualIdentificationOverlay.h */, 22962 2D7DA0F12435EB1800F048D1 /* WebViewVisualIdentificationOverlay.mm */, 22958 22963 ); 22959 22964 path = cocoa; … … 33436 33441 0F580FA31496939100FB5BD8 /* WebTiledBackingLayer.h in Headers */, 33437 33442 3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */, 33443 2D7DA0F22435EB1900F048D1 /* WebViewVisualIdentificationOverlay.h in Headers */, 33438 33444 F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */, 33439 33445 5D21A80313ECE5DF00BB7064 /* WebVTTParser.h in Headers */, -
trunk/Source/WebKit/ChangeLog
r259507 r259512 1 2020-04-03 Tim Horton <timothy_horton@apple.com> 2 3 Add a visual debug indicator for locating and identifying all kinds of WebViews 4 https://bugs.webkit.org/show_bug.cgi?id=209982 5 <rdar://problem/60339870> 6 7 Reviewed by Simon Fraser. 8 9 * UIProcess/API/Cocoa/WKWebView.mm: 10 (-[WKWebView _initializeWithConfiguration:]): 11 * UIProcess/API/mac/WKView.mm: 12 (-[WKView initWithFrame:processPool:configuration:]): 13 Adopt in WKWebView and WKView. 14 1 15 2020-04-03 Kate Cheney <katherine_cheney@apple.com> 2 16 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r259507 r259512 128 128 #import <WebCore/TextManipulationController.h> 129 129 #import <WebCore/ViewportArguments.h> 130 #import <WebCore/WebViewVisualIdentificationOverlay.h> 130 131 #import <WebCore/WritingMode.h> 131 132 #import <wtf/BlockPtr.h> … … 404 405 405 406 pageToViewMap().add(_page.get(), self); 407 408 [WebViewVisualIdentificationOverlay installForWebViewIfNeeded:self kind:@"WKWebView" deprecated:NO]; 406 409 407 410 #if PLATFORM(IOS_FAMILY) -
trunk/Source/WebKit/UIProcess/API/mac/WKView.mm
r259399 r259512 44 44 #import "WebViewImpl.h" 45 45 #import "_WKLinkIconParametersInternal.h" 46 #import <WebCore/WebViewVisualIdentificationOverlay.h> 46 47 #import <WebKit/WKDragDestinationAction.h> 47 48 #import <pal/spi/cocoa/AVKitSPI.h> … … 964 965 965 966 [self maybeInstallIconLoadingClient]; 967 [WebViewVisualIdentificationOverlay installForWebViewIfNeeded:self kind:@"WKView" deprecated:YES]; 966 968 967 969 return self; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r259466 r259512 1 2020-04-03 Tim Horton <timothy_horton@apple.com> 2 3 Add a visual debug indicator for locating and identifying all kinds of WebViews 4 https://bugs.webkit.org/show_bug.cgi?id=209982 5 <rdar://problem/60339870> 6 7 Reviewed by Simon Fraser. 8 9 * WebView/WebView.mm: 10 (-[WebView _commonInitializationWithFrameName:groupName:]): 11 Adopt for WebView on macOS (UIWebView will install it itself on iOS). 12 13 * WebView/WebViewPrivate.h: 14 Expose _installVisualIdentificationOverlayForViewIfNeeded:kind: for UIWebView's use. 15 It is slightly unfortunate to expose SPI that uses UIView from a framework 16 underneath UIKit, but there is no other single place where this code can live 17 and not be a minor layering problem. Since it's debug UI, it seems passable. 18 1 19 2020-04-03 David Kilzer <ddkilzer@apple.com> 2 20 -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r259184 r259512 222 222 #import <WebCore/WebCoreObjCExtras.h> 223 223 #import <WebCore/WebCoreView.h> 224 #import <WebCore/WebViewVisualIdentificationOverlay.h> 224 225 #import <WebCore/Widget.h> 225 226 #import <WebKitLegacy/DOM.h> … … 1601 1602 1602 1603 _private->page->settings().setContentDispositionAttachmentSandboxEnabled(true); 1604 1605 #if PLATFORM(MAC) 1606 [WebViewVisualIdentificationOverlay installForWebViewIfNeeded:self kind:@"WebView" deprecated:YES]; 1607 #endif 1603 1608 } 1604 1609 … … 10221 10226 } 10222 10227 10228 - (void)_installVisualIdentificationOverlayForViewIfNeeded:(id)view kind:(NSString *)kind 10229 { 10230 [WebViewVisualIdentificationOverlay installForWebViewIfNeeded:static_cast<UIView *>(view) kind:kind deprecated:YES]; 10231 } 10232 10223 10233 @end 10224 10234 -
trunk/Source/WebKitLegacy/mac/WebView/WebViewPrivate.h
r257143 r259512 1089 1089 - (NSArray<DOMElement *> *)_editableElementsInRect:(CGRect)rect; 1090 1090 - (void)revealCurrentSelection; 1091 1092 // View must be a UIView. 1093 - (void)_installVisualIdentificationOverlayForViewIfNeeded:(id)view kind:(NSString *)kind; 1091 1094 @end 1092 1095
Note: See TracChangeset
for help on using the changeset viewer.