(Finally...) get rid of WKViewIOS
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Aug 2015 23:11:25 +0000 (23:11 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Aug 2015 23:11:25 +0000 (23:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148404

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKView.h:
* UIProcess/API/ios/WKViewIOS.mm: Removed.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::PageClientImpl): Deleted.
(WebKit::PageClientImpl::didRelaunchProcess): Deleted.
(WebKit::PageClientImpl::refView): Deleted.
(WebKit::PageClientImpl::derefView): Deleted.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:processPool:configuration:wkView:]): Deleted.
* WebKit2.xcodeproj/project.pbxproj:
Get rid of WKViewIOS and references to it.

* DatabaseProcess/ios/DatabaseProcessIOS.mm:
(WebKit::DatabaseProcess::initializeSandbox):
* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::initializeSandbox):
* Shared/Plugins/mac/PluginSandboxProfile.mm:
(WebKit::pluginSandboxProfileDirectory):
* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::initializeSandbox):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeSandbox):
Look for WKWebView instead of WKView if we have it.

* TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm:
* TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.h:
* TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.mm:
Mark tests that use WKBrowsingContextController as Mac-only.

* WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
(WTR::AccessibilityController::addNotificationListener):
* WebKitTestRunner/ios/mainIOS.mm:
(-[WebKitTestRunnerApp applicationDidEnterBackground:]):
Import UIKit instead of depending on WKView.h to do so.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188892 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/ios/DatabaseProcessIOS.mm
Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm
Source/WebKit2/Shared/Plugins/mac/PluginSandboxProfile.mm
Source/WebKit2/Shared/ios/ChildProcessIOS.mm
Source/WebKit2/UIProcess/API/Cocoa/WKView.h
Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm [deleted file]
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/WKContentView.h
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm
Tools/TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm
Tools/TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.h
Tools/TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.mm
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm
Tools/WebKitTestRunner/ios/mainIOS.mm

index ee27735..2f9a3d2 100644 (file)
@@ -1,3 +1,36 @@
+2015-08-24  Tim Horton  <timothy_horton@apple.com>
+
+        (Finally...) get rid of WKViewIOS
+        https://bugs.webkit.org/show_bug.cgi?id=148404
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/Cocoa/WKView.h:
+        * UIProcess/API/ios/WKViewIOS.mm: Removed.
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::PageClientImpl): Deleted.
+        (WebKit::PageClientImpl::didRelaunchProcess): Deleted.
+        (WebKit::PageClientImpl::refView): Deleted.
+        (WebKit::PageClientImpl::derefView): Deleted.
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView initWithFrame:processPool:configuration:wkView:]): Deleted.
+        * WebKit2.xcodeproj/project.pbxproj:
+        Get rid of WKViewIOS and references to it.
+
+        * DatabaseProcess/ios/DatabaseProcessIOS.mm:
+        (WebKit::DatabaseProcess::initializeSandbox):
+        * NetworkProcess/ios/NetworkProcessIOS.mm:
+        (WebKit::NetworkProcess::initializeSandbox):
+        * Shared/Plugins/mac/PluginSandboxProfile.mm:
+        (WebKit::pluginSandboxProfileDirectory):
+        * Shared/ios/ChildProcessIOS.mm:
+        (WebKit::ChildProcess::initializeSandbox):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::initializeSandbox):
+        Look for WKWebView instead of WKView if we have it.
+
 2015-08-24  Anders Carlsson  <andersca@apple.com>
 
         Rename _WKVisitedLinkProvider to _WKVisitedLinkStore for consistency
index 4e820b0..f04eae5 100644 (file)
@@ -53,7 +53,7 @@ void DatabaseProcess::initializeSandbox(const ChildProcessInitializationParamete
 {
 #if ENABLE_MANUAL_DATABASE_SANDBOXING
     // Need to override the default, because service has a different bundle ID.
-    NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+    NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")];
     sandboxParameters.setOverrideSandboxProfilePath([webkit2Bundle pathForResource:@"com.apple.WebKit.Databases" ofType:@"sb"]);
     ChildProcess::initializeSandbox(parameters, sandboxParameters);
 #endif
index 1d7e052..cd5dec6 100644 (file)
@@ -61,7 +61,7 @@ void NetworkProcess::initializeSandbox(const ChildProcessInitializationParameter
 {
 #if ENABLE_MANUAL_NETWORK_SANDBOXING
     // Need to override the default, because service has a different bundle ID.
-    NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+    NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")];
     sandboxParameters.setOverrideSandboxProfilePath([webkit2Bundle pathForResource:@"com.apple.WebKit.NetworkProcess" ofType:@"sb"]);
 
     ChildProcess::initializeSandbox(parameters, sandboxParameters);
index 2735c3a..63c9bca 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "PluginSandboxProfile.h"
 
+#include "WKFoundation.h"
 #include <wtf/RetainPtr.h>
 #include <wtf/text/StringConcatenate.h>
 #include <wtf/text/WTFString.h>
@@ -34,7 +35,12 @@ namespace WebKit {
 
 static NSString *pluginSandboxProfileDirectory()
 {
-    return [[[NSBundle bundleForClass:NSClassFromString(@"WKView")] resourcePath] stringByAppendingPathComponent:@"PlugInSandboxProfiles"];
+#if WK_API_ENABLED
+    NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")];
+#else
+    NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+#endif
+    return [[bundle resourcePath] stringByAppendingPathComponent:@"PlugInSandboxProfiles"];
 }
 
 static NSString *pluginSandboxProfileName(const String& bundleIdentifier)
index ac62411..5dbeced 100644 (file)
@@ -71,7 +71,7 @@ void ChildProcess::platformInitialize()
 void ChildProcess::initializeSandbox(const ChildProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters)
 {
 #if ENABLE(MANUAL_SANDBOXING)
-    NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+    NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")];
     String defaultProfilePath = [webkit2Bundle pathForResource:[[NSBundle mainBundle] bundleIdentifier] ofType:@"sb"];
     if (sandboxParameters.systemDirectorySuffix().isNull()) {
         String defaultSystemDirectorySuffix = String([[NSBundle mainBundle] bundleIdentifier]) + "+" + parameters.clientIdentifier;
index 2ae46ba..1993b9a 100644 (file)
 
 #import <WebKit/WKFoundation.h>
 
-#if TARGET_OS_IPHONE
-#import <UIKit/UIKit.h>
-#else
+#if !TARGET_OS_IPHONE
+
 #import <Cocoa/Cocoa.h>
-#endif
 #import <WebKit/WKDeclarationSpecifiers.h>
 
 @class WKBrowsingContextController;
 @class WKProcessGroup;
 @class WKViewData;
 
-#if TARGET_OS_IPHONE
-WK_EXPORT
-@interface WKView : UIView {
-#else
 WK_EXPORT
 @interface WKView : NSView <NSTextInputClient> {
-#endif
 @private
     WKViewData *_data;
     unsigned _unused;
@@ -51,13 +44,8 @@ WK_EXPORT
 
 #if WK_API_ENABLED
 
-#if TARGET_OS_IPHONE
-- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup;
-- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup relatedToView:(WKView *)relatedView;
-#else
 - (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup;
 - (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup relatedToView:(WKView *)relatedView;
-#endif
 
 @property(readonly) WKBrowsingContextController *browsingContextController;
 
@@ -66,8 +54,6 @@ WK_EXPORT
 @property BOOL drawsBackground;
 @property BOOL drawsTransparentBackground;
 
-#if TARGET_OS_IPHONE
-@property (nonatomic, readonly) UIScrollView *scrollView;
-#endif
-
 @end
+
+#endif
diff --git a/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm b/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm
deleted file mode 100644 (file)
index 14ebd58..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (C) 2013, 2014 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 "WKViewPrivate.h"
-
-#if PLATFORM(IOS)
-
-#import "APIPageConfiguration.h"
-#import "RemoteLayerTreeTransaction.h"
-#import "UIKitSPI.h"
-#import "ViewGestureController.h"
-#import "WKAPICast.h"
-#import "WKBrowsingContextGroupPrivate.h"
-#import "WKContentView.h"
-#import "WKPageConfigurationRef.h"
-#import "WKProcessGroupPrivate.h"
-#import "WKScrollView.h"
-#import "WebPageGroup.h"
-#import "WebPageProxy.h"
-#import "WebProcessPool.h"
-#import <UIKit/UIScreen.h>
-#import <wtf/RetainPtr.h>
-
-using namespace WebKit;
-
-@interface WKView () <UIScrollViewDelegate>
-@end
-
-@interface UIScrollView (UIScrollViewInternal)
-- (void)_adjustForAutomaticKeyboardInfo:(NSDictionary*)info animated:(BOOL)animated lastAdjustment:(CGFloat*)lastAdjustment;
-@end
-
-@implementation WKView {
-    RetainPtr<WKScrollView> _scrollView;
-    RetainPtr<WKContentView> _contentView;
-
-    BOOL _isWaitingForNewLayerTreeAfterDidCommitLoad;
-    std::unique_ptr<ViewGestureController> _gestureController;
-    
-    BOOL _allowsBackForwardNavigationGestures;
-
-    BOOL _hasStaticMinimumLayoutSize;
-    CGSize _minimumLayoutSizeOverride;
-
-    UIEdgeInsets _obscuredInsets;
-    bool _isChangingObscuredInsetsInteractively;
-    CGFloat _lastAdjustmentForScroller;
-}
-
-- (id)initWithCoder:(NSCoder *)coder
-{
-    // FIXME: Implement.
-    [self release];
-    return nil;
-}
-
-- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup
-{
-    return [self initWithFrame:frame processGroup:processGroup browsingContextGroup:browsingContextGroup relatedToView:nil];
-}
-
-- (id)initWithFrame:(CGRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup relatedToView:(WKView *)relatedView
-{
-    if (!(self = [super initWithFrame:frame]))
-        return nil;
-
-    auto configuration = API::PageConfiguration::create();
-    configuration->setProcessPool(toImpl(processGroup._contextRef));
-    configuration->setPageGroup(toImpl(browsingContextGroup._pageGroupRef));
-    configuration->setRelatedPage(relatedView ? toImpl([relatedView pageRef]) : nullptr);
-
-    [self _commonInitializationWithConfigurationRef:toAPI(configuration.ptr())];
-    return self;
-}
-
-- (void)dealloc
-{
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-    [super dealloc];
-}
-
-- (void)setFrame:(CGRect)frame
-{
-    CGRect oldFrame = [self frame];
-    [super setFrame:frame];
-
-    if (!CGSizeEqualToSize(oldFrame.size, frame.size))
-        [self _frameOrBoundsChanged];
-}
-
-- (void)setBounds:(CGRect)bounds
-{
-    CGRect oldBounds = [self bounds];
-    [super setBounds:bounds];
-    
-    if (!CGSizeEqualToSize(oldBounds.size, bounds.size))
-        [self _frameOrBoundsChanged];
-}
-
-- (void)didMoveToWindow
-{
-    [_contentView page]->viewStateDidChange(WebCore::ViewState::AllFlags);
-}
-
-- (UIScrollView *)scrollView
-{
-    return _scrollView.get();
-}
-
-- (WKBrowsingContextController *)browsingContextController
-{
-    return [_contentView browsingContextController];
-}
-
-- (void)setAllowsBackForwardNavigationGestures:(BOOL)allowsBackForwardNavigationGestures
-{
-    if (_allowsBackForwardNavigationGestures == allowsBackForwardNavigationGestures)
-        return;
-
-    _allowsBackForwardNavigationGestures = allowsBackForwardNavigationGestures;
-    
-    WebPageProxy* webPageProxy = [_contentView page];
-    
-    if (allowsBackForwardNavigationGestures) {
-        if (!_gestureController) {
-            _gestureController = std::make_unique<ViewGestureController>(*webPageProxy);
-            _gestureController->installSwipeHandler(self, [self scrollView]);
-        }
-    } else
-        _gestureController = nullptr;
-    
-    webPageProxy->setShouldRecordNavigationSnapshots(allowsBackForwardNavigationGestures);
-}
-
-- (BOOL)allowsBackForwardNavigationGestures
-{
-    return _allowsBackForwardNavigationGestures;
-}
-
-#pragma mark - UIScrollViewDelegate
-
-- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
-{
-    ASSERT(_scrollView == scrollView);
-    return _contentView.get();
-}
-
-- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view
-{
-    [_contentView willStartZoomOrScroll];
-}
-
-- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
-{
-    [_contentView willStartZoomOrScroll];
-}
-
-- (void)_didFinishScrolling
-{
-    [self _updateVisibleContentRects];
-    [_contentView didFinishScrolling];
-}
-
-- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
-{
-    // If we're decelerating, scroll offset will be updated when scrollViewDidFinishDecelerating: is called.
-    if (!decelerate)
-        [self _didFinishScrolling];
-}
-
-- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
-{
-    [self _didFinishScrolling];
-}
-
-- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
-{
-    [self _didFinishScrolling];
-}
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView
-{
-    [self _updateVisibleContentRects];
-}
-
-- (void)scrollViewDidZoom:(UIScrollView *)scrollView
-{
-    [self _updateVisibleContentRects];
-}
-
-- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
-{
-    ASSERT(scrollView == _scrollView);
-    [self _updateVisibleContentRects];
-    [_contentView didZoomToScale:scale];
-}
-
-#pragma mark Internal
-
-- (void)_commonInitializationWithConfigurationRef:(WKPageConfigurationRef)configurationRef
-{
-    ASSERT(!_scrollView);
-    ASSERT(!_contentView);
-
-    CGRect bounds = self.bounds;
-
-    _scrollView = adoptNS([[WKScrollView alloc] initWithFrame:bounds]);
-    [_scrollView setBouncesZoom:YES];
-
-    [self addSubview:_scrollView.get()];
-
-    auto configuration = toImpl(configurationRef)->copy();
-
-    _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds processPool:*configuration->processPool() configuration:WTF::move(configuration) wkView:self]);
-
-    [[_contentView layer] setAnchorPoint:CGPointZero];
-    [_contentView setFrame:bounds];
-    [_scrollView addSubview:_contentView.get()];
-
-    [self _frameOrBoundsChanged];
-
-    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
-    [center addObserver:self selector:@selector(_keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
-    [center addObserver:self selector:@selector(_keyboardDidChangeFrame:) name:UIKeyboardDidChangeFrameNotification object:nil];
-    [center addObserver:self selector:@selector(_keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
-    [center addObserver:self selector:@selector(_keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
-}
-
-- (void)_frameOrBoundsChanged
-{
-    CGRect bounds = [self bounds];
-
-    WebPageProxy* webPageProxy = [_contentView page];
-    WebCore::FloatSize size(bounds.size);
-    webPageProxy->setViewportConfigurationMinimumLayoutSize(size);
-    webPageProxy->setMaximumUnobscuredSize(size);
-
-    [_scrollView setFrame:bounds];
-    webPageProxy->drawingArea()->setSize(WebCore::IntSize(bounds.size), WebCore::IntSize(), WebCore::IntSize());
-    [self _updateVisibleContentRects];
-}
-
-- (void)_updateVisibleContentRects
-{
-    CGRect fullViewRect = self.bounds;
-    CGRect visibleRectInContentCoordinates = [self convertRect:fullViewRect toView:_contentView.get()];
-
-    CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, _obscuredInsets);
-    CGRect unobscuredRectInContentCoordinates = [self convertRect:unobscuredRect toView:_contentView.get()];
-
-    [_contentView didUpdateVisibleRect:visibleRectInContentCoordinates
-        unobscuredRect:unobscuredRectInContentCoordinates
-        unobscuredRectInScrollViewCoordinates:unobscuredRect
-        scale:[_scrollView zoomScale] minimumScale:[_scrollView minimumZoomScale]
-        inStableState:YES isChangingObscuredInsetsInteractively:NO];
-}
-
-- (void)_keyboardChangedWithInfo:(NSDictionary *)keyboardInfo adjustScrollView:(BOOL)adjustScrollView
-{
-    // FIXME: We will also need to adjust the unobscured rect by taking into account the keyboard rect and the obscured insets.
-    if (adjustScrollView)
-        [_scrollView _adjustForAutomaticKeyboardInfo:keyboardInfo animated:YES lastAdjustment:&_lastAdjustmentForScroller];
-}
-
-- (void)_keyboardWillChangeFrame:(NSNotification *)notification
-{
-    if ([_contentView isAssistingNode])
-        [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES];
-}
-
-- (void)_keyboardDidChangeFrame:(NSNotification *)notification
-{
-    [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:NO];
-}
-
-- (void)_keyboardWillShow:(NSNotification *)notification
-{
-    if ([_contentView isAssistingNode])
-        [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES];
-}
-
-- (void)_keyboardWillHide:(NSNotification *)notification
-{
-    // Ignore keyboard will hide notifications sent during rotation. They're just there for
-    // backwards compatibility reasons and processing the will hide notification would
-    // temporarily screw up the the unobscured view area.
-    if ([[UIPeripheralHost sharedInstance] rotationState])
-        return;
-
-    [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES];
-}
-
-@end
-
-@implementation WKView (Private)
-
-- (WKPageRef)pageRef
-{
-    return toAPI([_contentView page]);
-}
-
-- (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef
-{
-    return [self initWithFrame:frame contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:nil];
-}
-
-- (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage
-{
-    auto configuration = API::PageConfiguration::create();
-    configuration->setProcessPool(toImpl(contextRef));
-    configuration->setPageGroup(toImpl(pageGroupRef));
-    configuration->setRelatedPage(toImpl(relatedPage));
-
-    return [self initWithFrame:frame contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:nil];
-}
-
-- (id)initWithFrame:(CGRect)frame configurationRef:(WKPageConfigurationRef)configuration
-{
-    if (!(self = [super initWithFrame:frame]))
-        return nil;
-
-    [self _commonInitializationWithConfigurationRef:configuration];
-    return self;
-}
-
-- (CGSize)minimumLayoutSizeOverride
-{
-    ASSERT(_hasStaticMinimumLayoutSize);
-    return _minimumLayoutSizeOverride;
-}
-
-- (void)setMinimumLayoutSizeOverride:(CGSize)minimumLayoutSizeOverride
-{
-    _hasStaticMinimumLayoutSize = YES;
-    _minimumLayoutSizeOverride = minimumLayoutSizeOverride;
-}
-
-- (void)_didRelaunchProcess
-{
-    // Update the WebView to our size rather than the default size it will have after being relaunched.
-    [self _frameOrBoundsChanged];
-}
-
-- (UIEdgeInsets)_obscuredInsets
-{
-    return _obscuredInsets;
-}
-
-- (void)_setObscuredInsets:(UIEdgeInsets)obscuredInsets
-{
-    ASSERT(obscuredInsets.top >= 0);
-    ASSERT(obscuredInsets.left >= 0);
-    ASSERT(obscuredInsets.bottom >= 0);
-    ASSERT(obscuredInsets.right >= 0);
-    _obscuredInsets = obscuredInsets;
-    [self _updateVisibleContentRects];
-}
-
-- (void)_beginInteractiveObscuredInsetsChange
-{
-    ASSERT(!_isChangingObscuredInsetsInteractively);
-    _isChangingObscuredInsetsInteractively = YES;
-}
-
-- (void)_endInteractiveObscuredInsetsChange
-{
-    ASSERT(_isChangingObscuredInsetsInteractively);
-    _isChangingObscuredInsetsInteractively = NO;
-}
-
-- (UIColor *)_pageExtendedBackgroundColor
-{
-    // This is deprecated. 
-    return nil;
-}
-
-- (void)_setBackgroundExtendsBeyondPage:(BOOL)backgroundExtends
-{
-    [_contentView page]->setBackgroundExtendsBeyondPage(backgroundExtends);
-}
-
-- (BOOL)_backgroundExtendsBeyondPage
-{
-    return [_contentView page]->backgroundExtendsBeyondPage();
-}
-
-@end
-
-#endif // PLATFORM(IOS)
index 038cd4e..96b5a00 100644 (file)
@@ -33,7 +33,6 @@
 #import <wtf/RetainPtr.h>
 
 OBJC_CLASS WKContentView;
-OBJC_CLASS WKView;
 OBJC_CLASS WKWebView;
 OBJC_CLASS WKEditorUndoTargetObjC;
 
@@ -46,7 +45,6 @@ class PageClientImpl : public PageClient
     {
 public:
     PageClientImpl(WKContentView *, WKWebView *);
-    PageClientImpl(WKContentView *, WKView *);
     virtual ~PageClientImpl();
     
 private:
@@ -191,7 +189,6 @@ private:
 
     WKContentView *m_contentView;
     WKWebView *m_webView;
-    WKView *m_wkView;
     RetainPtr<WKEditorUndoTargetObjC> m_undoTarget;
 };
 } // namespace WebKit
index f4918b6..7ca6857 100644 (file)
@@ -40,7 +40,6 @@
 #import "WKContentViewInteraction.h"
 #import "WKGeolocationProviderIOS.h"
 #import "WKProcessPoolInternal.h"
-#import "WKViewPrivate.h"
 #import "WKWebViewConfigurationInternal.h"
 #import "WKWebViewContentProviderRegistry.h"
 #import "WKWebViewInternal.h"
@@ -111,15 +110,6 @@ namespace WebKit {
 PageClientImpl::PageClientImpl(WKContentView *contentView, WKWebView *webView)
     : m_contentView(contentView)
     , m_webView(webView)
-    , m_wkView(nil)
-    , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
-{
-}
-
-PageClientImpl::PageClientImpl(WKContentView *contentView, WKView *wkView)
-    : m_contentView(contentView)
-    , m_webView(nil)
-    , m_wkView(wkView)
     , m_undoTarget(adoptNS([[WKEditorUndoTargetObjC alloc] init]))
 {
 }
@@ -223,7 +213,6 @@ void PageClientImpl::didRelaunchProcess()
 {
     [m_contentView _didRelaunchProcess];
     [m_webView _didRelaunchProcess];
-    [m_wkView _didRelaunchProcess];
 }
 
 void PageClientImpl::pageClosed()
@@ -743,14 +732,12 @@ void PageClientImpl::refView()
 {
     [m_contentView retain];
     [m_webView retain];
-    [m_wkView retain];
 }
 
 void PageClientImpl::derefView()
 {
     [m_contentView release];
     [m_webView release];
-    [m_wkView release];
 }
 
 } // namespace WebKit
index 390c785..b720da9 100644 (file)
@@ -31,7 +31,6 @@
 #import <wtf/RetainPtr.h>
 
 @class WKContentView;
-@class WKView;
 @class WKWebView;
 
 namespace API {
@@ -65,7 +64,6 @@ class WebProcessPool;
 @property (nonatomic, readonly) BOOL isBackground;
 
 - (instancetype)initWithFrame:(CGRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration webView:(WKWebView *)webView;
-- (instancetype)initWithFrame:(CGRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration wkView:(WKView *)webView;
 
 - (void)didUpdateVisibleRect:(CGRect)visibleRect unobscuredRect:(CGRect)unobscuredRect
     unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
index b29595c..587886a 100644 (file)
@@ -232,18 +232,6 @@ private:
     return [self _commonInitializationWithProcessPool:processPool configuration:WTF::move(configuration)];
 }
 
-- (instancetype)initWithFrame:(CGRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration wkView:(WKView *)wkView
-{
-    if (!(self = [super initWithFrame:frame]))
-        return nil;
-
-    InitializeWebKit2();
-
-    _pageClient = std::make_unique<PageClientImpl>(self, wkView);
-
-    return [self _commonInitializationWithProcessPool:processPool configuration:WTF::move(configuration)];
-}
-
 - (void)dealloc
 {
     [self cleanupInteraction];
index c1c44cf..0642946 100644 (file)
                2DA049B8180CCD0A00AAFA9E /* GraphicsLayerCARemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */; };
                2DA1E4FE18C02B6A00DBC929 /* WKPDFView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA1E4FC18C02B6A00DBC929 /* WKPDFView.h */; };
                2DA1E4FF18C02B6A00DBC929 /* WKPDFView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA1E4FD18C02B6A00DBC929 /* WKPDFView.mm */; };
-               2DA944951884E3B500ED86DB /* WKViewIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944861884E3B500ED86DB /* WKViewIOS.mm */; };
                2DA9449E1884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */; };
                2DA9449F1884E4F000ED86DB /* NativeWebTouchEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */; };
                2DA944A01884E4F000ED86DB /* WebIOSEventFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA944991884E4F000ED86DB /* WebIOSEventFactory.h */; };
                2DA1E4FC18C02B6A00DBC929 /* WKPDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKPDFView.h; path = ios/WKPDFView.h; sourceTree = "<group>"; };
                2DA1E4FD18C02B6A00DBC929 /* WKPDFView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKPDFView.mm; path = ios/WKPDFView.mm; sourceTree = "<group>"; };
                2DA7FDCB18F88625008DDED0 /* FindIndicatorOverlayClientIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FindIndicatorOverlayClientIOS.h; path = ios/FindIndicatorOverlayClientIOS.h; sourceTree = "<group>"; };
-               2DA944861884E3B500ED86DB /* WKViewIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKViewIOS.mm; path = ios/WKViewIOS.mm; sourceTree = "<group>"; };
                2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NativeWebKeyboardEventIOS.mm; path = ios/NativeWebKeyboardEventIOS.mm; sourceTree = "<group>"; };
                2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NativeWebTouchEventIOS.mm; path = ios/NativeWebTouchEventIOS.mm; sourceTree = "<group>"; };
                2DA944991884E4F000ED86DB /* WebIOSEventFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebIOSEventFactory.h; path = ios/WebIOSEventFactory.h; sourceTree = "<group>"; };
                        path = Cocoa;
                        sourceTree = "<group>";
                };
-               2DA944771884E3AB00ED86DB /* ios */ = {
-                       isa = PBXGroup;
-                       children = (
-                               2DA944861884E3B500ED86DB /* WKViewIOS.mm */,
-                       );
-                       name = ios;
-                       sourceTree = "<group>";
-               };
                2DA944961884E4DA00ED86DB /* ios */ = {
                        isa = PBXGroup;
                        children = (
                                BC0C376610F807660076D7CB /* C */,
                                37C4C08318149C2A003688B9 /* Cocoa */,
                                BC8A501311765F4500757573 /* cpp */,
-                               2DA944771884E3AB00ED86DB /* ios */,
                                BC111B47112F616900337BAB /* mac */,
                                076E884D1A13CADF005E90FC /* APIContextMenuClient.h */,
                                83891B621A68B3420030F386 /* APIDiagnosticLoggingClient.h */,
                                1AAF089A19267EE500B6390C /* WKUserScript.mm in Sources */,
                                7C89D2A31A678875003A5FDE /* WKUserScriptRef.cpp in Sources */,
                                BC8699B6116AADAA002A925B /* WKView.mm in Sources */,
-                               2DA944951884E3B500ED86DB /* WKViewIOS.mm in Sources */,
                                2D28A4981AF965A200F190C9 /* WKViewLayoutStrategy.mm in Sources */,
                                C5E1AFE816B20B67006CC1F2 /* WKWebArchive.cpp in Sources */,
                                C5E1AFEA16B20B7B006CC1F2 /* WKWebArchiveResource.cpp in Sources */,
index 4b90dc5..b3620ff 100644 (file)
@@ -213,11 +213,15 @@ void WebProcess::initializeSandbox(const ChildProcessInitializationParameters& p
 #if ENABLE(WEB_PROCESS_SANDBOX)
 #if ENABLE(MANUAL_SANDBOXING)
     // Need to override the default, because service has a different bundle ID.
-    NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+#if WK_API_ENABLED
+    NSBundle *webKit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")];
+#else
+    NSBundle *webKit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+#endif
 #if PLATFORM(IOS)
-    sandboxParameters.setOverrideSandboxProfilePath([webkit2Bundle pathForResource:@"com.apple.WebKit.WebContent" ofType:@"sb"]);
+    sandboxParameters.setOverrideSandboxProfilePath([webKit2Bundle pathForResource:@"com.apple.WebKit.WebContent" ofType:@"sb"]);
 #else
-    sandboxParameters.setOverrideSandboxProfilePath([webkit2Bundle pathForResource:@"com.apple.WebProcess" ofType:@"sb"]);
+    sandboxParameters.setOverrideSandboxProfilePath([webKit2Bundle pathForResource:@"com.apple.WebProcess" ofType:@"sb"]);
 #endif
     ChildProcess::initializeSandbox(parameters, sandboxParameters);
 #endif
index 0edab94..1ec8b1b 100644 (file)
@@ -1,3 +1,28 @@
+2015-08-24  Tim Horton  <timothy_horton@apple.com>
+
+        (Finally...) get rid of WKViewIOS
+        https://bugs.webkit.org/show_bug.cgi?id=148404
+
+        Reviewed by Anders Carlsson.
+
+        * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
+        * TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:
+        * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm:
+        * TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.h:
+        * TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.mm:
+        Mark tests that use WKBrowsingContextController as Mac-only.
+
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
+        (WTR::AccessibilityController::addNotificationListener):
+        * WebKitTestRunner/ios/mainIOS.mm:
+        (-[WebKitTestRunnerApp applicationDidEnterBackground:]):
+        Import UIKit instead of depending on WKView.h to do so.
+
 2015-08-24  Jason Marcell  <jmarcell@apple.com>
 
         Add support to dashboard for displaying Git SHA's as revisions.
index 8c6fee4..5003457 100644 (file)
@@ -40,7 +40,7 @@
 #import <WebKit/WKViewPrivate.h>
 #import <wtf/RetainPtr.h>
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 static bool testFinished = false;
 
index add6a1c..e661230 100644 (file)
@@ -25,7 +25,7 @@
 
 #import "config.h"
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 #import "PlatformUtilities.h"
 #import "TestProtocol.h"
index 23ec10a..9fb7f55 100644 (file)
@@ -33,7 +33,7 @@
 #import <WebKit/WebKit2.h>
 #import <wtf/RetainPtr.h>
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 static bool testFinished = false;
 
index 4632b86..770bbe2 100644 (file)
@@ -35,7 +35,7 @@
 #import <WebKit/WebKit2.h>
 #import <wtf/RetainPtr.h>
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 static bool testFinished = false;
 
index 0ee4747..b20245c 100644 (file)
@@ -36,7 +36,7 @@
 #import <WebKit/WebKit2.h>
 #import <WebKit/WKViewPrivate.h>
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 static bool testFinished = false;
 
index 2462368..94fa31d 100644 (file)
@@ -37,7 +37,7 @@
 #import <WebKit/WKViewPrivate.h>
 #import <WebKit/WebKit2.h>
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 static bool testFinished = false;
 static NSString *htmlString = @"<body style='background-color: red'>";
index 2ecff16..6a62e2b 100644 (file)
@@ -28,7 +28,7 @@
 
 #import <WebKit/WKBrowsingContextGroup.h>
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 TEST(WKBrowsingContextGroupTest, GetSetJavaScriptEnabled)
 {
index 59ffe42..9dfe052 100644 (file)
@@ -25,7 +25,7 @@
 
 #import <WebKit/WebKit2.h>
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 typedef void (^OnLoadBlock)(WKBrowsingContextController *);
 
index 59524d1..f35253d 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "TestBrowsingContextLoadDelegate.h"
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 @implementation TestBrowsingContextLoadDelegate
 
index ad06f08..d4c9f45 100644 (file)
@@ -33,6 +33,7 @@
 #import <JavaScriptCore/JSRetainPtr.h>
 #import <JavaScriptCore/JSStringRef.h>
 #import <JavaScriptCore/JSStringRefCF.h>
+#import <UIKit/UIAccessibility.h>
 #import <WebKit/WKBundle.h>
 #import <WebKit/WKBundlePage.h>
 #import <WebKit/WKBundlePagePrivate.h>
@@ -49,8 +50,8 @@ bool AccessibilityController::addNotificationListener(JSValueRef functionCallbac
     if (m_globalNotificationHandler)
         return false;
     m_globalNotificationHandler = [[AccessibilityNotificationHandler alloc] init];
-    [m_globalNotificationHandler.get() setCallback:functionCallback];
-    [m_globalNotificationHandler.get() startObserving];
+    [m_globalNotificationHandler setCallback:functionCallback];
+    [m_globalNotificationHandler startObserving];
     
     return true;
 }
index 7f0ceea..711cd42 100644 (file)
@@ -26,7 +26,7 @@
 #import "config.h"
 
 #import "TestController.h"
-
+#import <UIKit/UIKit.h>
 
 static int _argc;
 static const char **_argv;
@@ -58,7 +58,6 @@ static const char **_argv;
     };
 
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-
         NSTimeInterval timeRemaining;
         while (true) {
             timeRemaining = [application backgroundTimeRemaining];