Changeset 254360 in webkit
- Timestamp:
- Jan 10, 2020 11:56:50 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r254356 r254360 1 2020-01-10 Simon Fraser <simon.fraser@apple.com> 2 3 [macOS UI-side compositing] Introduce WKScrollView and WKContentView for macOS 4 https://bugs.webkit.org/show_bug.cgi?id=206042 5 6 Reviewed by Tim Horton. 7 8 Add WKScrollViewMac and WKWebViewMac, with bare-bones implementations. WKScrollViewMac 9 has a WKScrollViewDelegate to make it more iOS-like, to avoid clients having to register 10 boundsDidChange notifications, and WKWebView on macOS becomes the delegate. 11 12 These views are only created when UI-side compositing is enabled. 13 14 * SourcesCocoa.txt: 15 * UIProcess/API/Cocoa/WKWebView.mm: 16 (-[WKWebView _initializeWithConfiguration:]): 17 * UIProcess/API/Cocoa/WKWebViewInternal.h: 18 * UIProcess/API/mac/WKContentViewMac.h: Added. 19 * UIProcess/API/mac/WKContentViewMac.mm: Added. 20 (-[WKContentView initWithFrame:page:]): 21 (-[WKContentView isFlipped]): 22 (-[WKContentView _setAcceleratedCompositingRootLayer:]): 23 * UIProcess/API/mac/WKScrollViewMac.h: Added. 24 * UIProcess/API/mac/WKScrollViewMac.mm: Added. 25 (+[WKScrollView isCompatibleWithResponsiveScrolling]): 26 (-[WKScrollView initWithFrame:]): 27 (-[WKScrollView dealloc]): 28 (-[WKScrollView delegate]): 29 (-[WKScrollView setDelegate:]): 30 (-[WKScrollView contentOffset]): 31 (-[WKScrollView boundsDidChange:]): 32 (-[WKScrollView setContentInsets:]): 33 * UIProcess/API/mac/WKWebViewMac.h: 34 * UIProcess/API/mac/WKWebViewMac.mm: 35 (-[WKWebView scrollViewDidScroll:]): 36 (-[WKWebView scrollViewContentInsetsDidChange:]): 37 (-[WKWebView _setupScrollAndContentViews]): 38 * UIProcess/ios/WebPageProxyIOS.mm: 39 * WebKit.xcodeproj/project.pbxproj: 40 1 41 2020-01-10 Jiewen Tan <jiewen_tan@apple.com> 2 42 -
trunk/Source/WebKit/SourcesCocoa.txt
r254345 r254360 335 335 UIProcess/API/ios/WKWebViewTestingIOS.mm 336 336 337 UIProcess/API/mac/WKContentViewMac.mm 338 UIProcess/API/mac/WKScrollViewMac.mm 337 339 UIProcess/API/mac/WKView.mm 338 340 UIProcess/API/mac/WKWebViewMac.mm -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r254315 r254360 162 162 #if PLATFORM(MAC) 163 163 #import "AppKitSPI.h" 164 #import "WKContentViewMac.h" 164 165 #import "WKTextFinderClient.h" 165 166 #import "WKViewInternal.h" … … 315 316 316 317 _usePlatformFindUI = YES; 318 317 319 #if PLATFORM(IOS_FAMILY) 318 320 _avoidsUnsafeArea = YES; … … 357 359 _page = &_impl->page(); 358 360 361 if (_impl->isUsingUISideCompositing()) 362 _contentView = adoptNS([[WKContentView alloc] initWithFrame:self.bounds page:_page.copyRef()]); 363 359 364 _impl->setAutomaticallyAdjustsContentInsets(true); 360 365 _impl->setRequiresUserActionForEditingControlsManager([configuration _requiresUserActionForEditingControlsManager]); 366 367 [self _setupScrollAndContentViews]; 361 368 #endif 362 369 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
r254241 r254360 84 84 } 85 85 86 @class WKContentView; 87 @class WKPasswordView; 88 @class WKSafeBrowsingWarning; 89 @class WKScrollView; 86 90 @class WKWebViewContentProviderRegistry; 87 @class WKPasswordView;88 91 @class _WKFrameHandle; 89 @class WKSafeBrowsingWarning; 90 91 #if PLATFORM(IOS_FAMILY) 92 @class WKScrollView; 92 93 #if PLATFORM(IOS_FAMILY) 93 94 @class WKFullScreenWindowController; 94 95 @protocol WKWebViewContentProvider; … … 127 128 std::unique_ptr<WebKit::WebViewImpl> _impl; 128 129 RetainPtr<WKTextFinderClient> _textFinderClient; 130 131 // Only used with UI-side compositing. 132 RetainPtr<WKScrollView> _scrollView; 133 RetainPtr<WKContentView> _contentView; 129 134 #endif 130 135 -
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.h
r253527 r254360 28 28 #if PLATFORM(MAC) 29 29 30 #import "WKScrollViewMac.h" 30 31 #import "WebViewImpl.h" 31 32 #import "_WKOverlayScrollbarStyle.h" 32 33 #import <WebCore/ScrollTypes.h> 33 34 34 @protocol WebViewImplDelegate;35 36 35 _WKOverlayScrollbarStyle toAPIScrollbarStyle(Optional<WebCore::ScrollbarOverlayStyle>); 37 36 Optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOverlayScrollbarStyle); 38 37 39 @interface WKWebView (WKInternalMac) <WebViewImplDelegate> 38 @interface WKWebView (WKInternalMac) <WebViewImplDelegate, WKScrollViewDelegate> 39 40 - (void)_setupScrollAndContentViews; 40 41 41 42 - (void)_takeFindStringFromSelectionInternal:(id)sender; -
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
r253527 r254360 31 31 #import "AppKitSPI.h" 32 32 #import "VersionChecks.h" 33 #import "WKContentViewMac.h" 33 34 #import "WKSafeBrowsingWarning.h" 35 #import "WKScrollViewMac.h" 34 36 #import "WKTextFinderClient.h" 35 37 #import "WKUIDelegatePrivate.h" … … 1208 1210 } 1209 1211 1212 #pragma mark - WKScrollViewDelegate 1213 1214 - (void)scrollViewDidScroll:(NSScrollView *)scrollView 1215 { 1216 // Only called with UI-side compositing. 1217 } 1218 1219 - (void)scrollViewContentInsetsDidChange:(NSScrollView *)scrollView 1220 { 1221 // Only called with UI-side compositing. 1222 } 1223 1224 #pragma mark - 1225 1226 - (void)_setupScrollAndContentViews 1227 { 1228 if (!_impl->isUsingUISideCompositing()) 1229 return; 1230 1231 _scrollView = adoptNS([[WKScrollView alloc] initWithFrame:[self bounds]]); 1232 [_scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; 1233 [self addSubview:_scrollView.get() positioned:NSWindowBelow relativeTo:nil]; 1234 1235 // The content view will get resized to fit the content. 1236 [_scrollView setDocumentView:_contentView.get()]; 1237 [_scrollView setDelegate:self]; 1238 } 1239 1210 1240 @end 1211 1241 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r254345 r254360 102 102 0E97D74D200E900400BF6643 /* SafeBrowsingSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0E97D74C200E8FF300BF6643 /* SafeBrowsingSPI.h */; }; 103 103 0EDE85032004E75D00030560 /* WebsitePopUpPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0EDE85022004E74900030560 /* WebsitePopUpPolicy.h */; }; 104 0F04159C23C7CC730060A3E2 /* WKScrollViewMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F04159823C7CC720060A3E2 /* WKScrollViewMac.h */; }; 105 0F04159E23C7CC730060A3E2 /* WKContentViewMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F04159A23C7CC730060A3E2 /* WKContentViewMac.h */; }; 104 106 0F08CF521D63C13A00B48DF1 /* WKFormSelectPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F08CF511D63C13A00B48DF1 /* WKFormSelectPicker.h */; }; 105 107 0F08CF541D63C14000B48DF1 /* WKFormSelectPopover.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F08CF531D63C14000B48DF1 /* WKFormSelectPopover.h */; }; … … 2090 2092 0E97D74C200E8FF300BF6643 /* SafeBrowsingSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SafeBrowsingSPI.h; sourceTree = "<group>"; }; 2091 2093 0EDE85022004E74900030560 /* WebsitePopUpPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebsitePopUpPolicy.h; sourceTree = "<group>"; }; 2094 0F04159823C7CC720060A3E2 /* WKScrollViewMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKScrollViewMac.h; sourceTree = "<group>"; }; 2095 0F04159923C7CC730060A3E2 /* WKContentViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKContentViewMac.mm; sourceTree = "<group>"; }; 2096 0F04159A23C7CC730060A3E2 /* WKContentViewMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentViewMac.h; sourceTree = "<group>"; }; 2097 0F04159B23C7CC730060A3E2 /* WKScrollViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKScrollViewMac.mm; sourceTree = "<group>"; }; 2092 2098 0F08CF511D63C13A00B48DF1 /* WKFormSelectPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKFormSelectPicker.h; path = ios/forms/WKFormSelectPicker.h; sourceTree = "<group>"; }; 2093 2099 0F08CF531D63C14000B48DF1 /* WKFormSelectPopover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKFormSelectPopover.h; path = ios/forms/WKFormSelectPopover.h; sourceTree = "<group>"; }; … … 8734 8740 isa = PBXGroup; 8735 8741 children = ( 8742 0F04159A23C7CC730060A3E2 /* WKContentViewMac.h */, 8743 0F04159923C7CC730060A3E2 /* WKContentViewMac.mm */, 8744 0F04159823C7CC720060A3E2 /* WKScrollViewMac.h */, 8745 0F04159B23C7CC730060A3E2 /* WKScrollViewMac.mm */, 8736 8746 BC8699B3116AADAA002A925B /* WKView.mm */, 8737 8747 BC8699B4116AADAA002A925B /* WKViewInternal.h */, … … 10727 10737 0FCB4E4C18BBE044000FCFC9 /* WKContentView.h in Headers */, 10728 10738 0FCB4E6C18BBF26A000FCFC9 /* WKContentViewInteraction.h in Headers */, 10739 0F04159E23C7CC730060A3E2 /* WKContentViewMac.h in Headers */, 10729 10740 BCB9E24B1120E15C00A137E0 /* WKContext.h in Headers */, 10730 10741 1AE52F981920267200A1FA37 /* WKContextConfigurationRef.h in Headers */, … … 10943 10954 7CC99A3618EF7CBC0048C8B4 /* WKScriptMessageInternal.h in Headers */, 10944 10955 0FCB4E5418BBE044000FCFC9 /* WKScrollView.h in Headers */, 10956 0F04159C23C7CC730060A3E2 /* WKScrollViewMac.h in Headers */, 10945 10957 51CD1C651B34B9D400142CA5 /* WKSecurityOrigin.h in Headers */, 10946 10958 51CD1C671B34B9DF00142CA5 /* WKSecurityOriginInternal.h in Headers */,
Note: See TracChangeset
for help on using the changeset viewer.