Diff
Modified: trunk/Source/WebKit/ChangeLog (243552 => 243553)
--- trunk/Source/WebKit/ChangeLog 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/ChangeLog 2019-03-27 18:22:59 UTC (rev 243553)
@@ -1,3 +1,36 @@
+2019-03-27 Tim Horton <[email protected]>
+
+ Fix some more deprecation warnings in WKDrawingView
+ https://bugs.webkit.org/show_bug.cgi?id=196282
+ <rdar://problem/47637608>
+
+ Reviewed by Wenson Hsieh.
+
+ * Platform/spi/ios/PencilKitSPI.h:
+ * SourcesCocoa.txt:
+ * UIProcess/ios/PencilKitSoftLink.h:
+ * UIProcess/ios/PencilKitSoftLink.mm:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ * UIProcess/ios/WKDrawingCoordinator.h:
+ * UIProcess/ios/WKDrawingCoordinator.mm:
+ (-[WKDrawingCoordinator initWithContentView:]):
+ (-[WKDrawingCoordinator currentInk]):
+ (-[WKDrawingCoordinator undoManagerForInkPicker:]):
+ (-[WKDrawingCoordinator containingViewForInkPicker:]):
+ (-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
+ (-[WKDrawingCoordinator inkPickerDidChangeInk:]):
+ (-[WKDrawingCoordinator installInkPickerForDrawing:]):
+ (-[WKDrawingCoordinator uninstallInkPicker]):
+ (-[WKDrawingCoordinator inkPicker]): Deleted.
+ (-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
+ (-[WKDrawingCoordinator didChangeInk:]): Deleted.
+ * UIProcess/ios/WKDrawingView.mm:
+ (-[WKDrawingView _canvasViewWillBeginDrawing:]):
+ * UIProcess/ios/WKInkPickerView.h: Removed.
+ * UIProcess/ios/WKInkPickerView.mm: Removed.
+ * WebKit.xcodeproj/project.pbxproj:
+ Adopt the new names.
+
2019-03-27 Carlos Garcia Campos <[email protected]>
Geolocation request not complete when watch request was started in a different web process
Modified: trunk/Source/WebKit/Platform/spi/ios/PencilKitSPI.h (243552 => 243553)
--- trunk/Source/WebKit/Platform/spi/ios/PencilKitSPI.h 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/Platform/spi/ios/PencilKitSPI.h 2019-03-27 18:22:59 UTC (rev 243553)
@@ -31,8 +31,6 @@
#import <PencilKit/PKCanvasView_Private.h>
#import <PencilKit/PKDrawing_Private.h>
#import <PencilKit/PKImageRenderer.h>
-#import <PencilKit/PKInlineInkPicker.h>
-#import <PencilKit/PKInlineInkPicker_Private.h>
#import <PencilKit/PKStroke.h>
#else
Modified: trunk/Source/WebKit/SourcesCocoa.txt (243552 => 243553)
--- trunk/Source/WebKit/SourcesCocoa.txt 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/SourcesCocoa.txt 2019-03-27 18:22:59 UTC (rev 243553)
@@ -404,7 +404,6 @@
UIProcess/ios/WKDrawingView.mm
UIProcess/ios/WKGeolocationProviderIOS.mm
UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm
-UIProcess/ios/WKInkPickerView.mm
UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm
UIProcess/ios/WKKeyboardScrollingAnimator.mm
UIProcess/ios/WKPasswordView.mm
Modified: trunk/Source/WebKit/UIProcess/ios/PencilKitSoftLink.h (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/PencilKitSoftLink.h 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/PencilKitSoftLink.h 2019-03-27 18:22:59 UTC (rev 243553)
@@ -34,6 +34,5 @@
SOFT_LINK_CLASS_FOR_HEADER(WebKit, PKCanvasView);
SOFT_LINK_CLASS_FOR_HEADER(WebKit, PKDrawing);
SOFT_LINK_CLASS_FOR_HEADER(WebKit, PKImageRenderer);
-SOFT_LINK_CLASS_FOR_HEADER(WebKit, PKInlineInkPicker);
#endif // HAVE(PENCILKIT)
Modified: trunk/Source/WebKit/UIProcess/ios/PencilKitSoftLink.mm (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/PencilKitSoftLink.mm 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/PencilKitSoftLink.mm 2019-03-27 18:22:59 UTC (rev 243553)
@@ -34,6 +34,5 @@
SOFT_LINK_CLASS_FOR_SOURCE(WebKit, PencilKit, PKCanvasView);
SOFT_LINK_CLASS_FOR_SOURCE(WebKit, PencilKit, PKDrawing);
SOFT_LINK_CLASS_FOR_SOURCE(WebKit, PencilKit, PKImageRenderer);
-SOFT_LINK_CLASS_FOR_SOURCE(WebKit, PencilKit, PKInlineInkPicker);
#endif // HAVE(PENCILKIT)
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-03-27 18:22:59 UTC (rev 243553)
@@ -48,7 +48,6 @@
#import "WKFormInputControl.h"
#import "WKFormSelectControl.h"
#import "WKImagePreviewViewController.h"
-#import "WKInkPickerView.h"
#import "WKInspectorNodeSearchGestureRecognizer.h"
#import "WKNSURLExtras.h"
#import "WKPreviewActionItemIdentifiers.h"
Modified: trunk/Source/WebKit/UIProcess/ios/WKDrawingCoordinator.h (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/WKDrawingCoordinator.h 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/WKDrawingCoordinator.h 2019-03-27 18:22:59 UTC (rev 243553)
@@ -30,7 +30,6 @@
OBJC_CLASS PKInk;
OBJC_CLASS WKContentView;
-OBJC_CLASS WKInkPickerView;
@interface WKDrawingCoordinator : NSObject <PKRulerHostingDelegate>
@@ -40,11 +39,9 @@
- (void)installInkPickerForDrawing:(WebCore::GraphicsLayer::EmbeddedViewID)embeddedViewID;
- (void)uninstallInkPicker;
-- (void)didChangeRulerState:(BOOL)rulerEnabled;
-- (void)didChangeInk:(PKInk *)ink;
+@property (nonatomic) BOOL rulerEnabled;
+@property (nonatomic, readonly, retain) PKInk *currentInk;
-@property (nonatomic, readonly, retain) WKInkPickerView *inkPicker;
-
@end
Modified: trunk/Source/WebKit/UIProcess/ios/WKDrawingCoordinator.mm (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/WKDrawingCoordinator.mm 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/WKDrawingCoordinator.mm 2019-03-27 18:22:59 UTC (rev 243553)
@@ -30,16 +30,20 @@
#import "EditableImageController.h"
#import "WKContentViewInteraction.h"
-#import "WKInkPickerView.h"
+#import "WKDrawingView.h"
#import "WKWebView.h"
+#import <WebKitAdditions/WKDrawingCoordinatorAdditions.mm>
#import <wtf/RetainPtr.h>
#import "PencilKitSoftLink.h"
+@interface WKDrawingCoordinator () <WKInkPickerDelegate>
+@end
+
@implementation WKDrawingCoordinator {
__weak WKContentView *_contentView;
- RetainPtr<WKInkPickerView> _inkPicker;
+ RetainPtr<WKInkPicker> _inkPicker;
WebCore::GraphicsLayer::EmbeddedViewID _focusedEmbeddedViewID;
}
@@ -51,14 +55,13 @@
return nil;
_contentView = contentView;
- _inkPicker = adoptNS([[WKInkPickerView alloc] initWithContentView:_contentView]);
return self;
}
-- (WKInkPickerView *)inkPicker
+- (PKInk *)currentInk
{
- return _inkPicker.get();
+ return [_inkPicker currentInk];
}
- (UIView *)rulerHostingView
@@ -79,41 +82,44 @@
return focusedEditableImage->drawingView.get();
}
-- (void)didChangeRulerState:(BOOL)rulerEnabled
+- (NSUndoManager *)undoManagerForInkPicker:(WKInkPicker *)inkPicker
{
- [self._focusedDrawingView didChangeRulerState:rulerEnabled];
+ return [_contentView undoManager];
}
-- (void)didChangeInk:(PKInk *)ink
+- (UIView *)containingViewForInkPicker:(WKInkPicker *)inkPicker
{
- [self._focusedDrawingView didChangeInk:ink];
+ return _contentView;
}
+- (void)inkPickerDidToggleRuler:(WKInkPicker *)inkPicker
+{
+ _rulerEnabled = !_rulerEnabled;
+ [self._focusedDrawingView didChangeRulerState:_rulerEnabled];
+}
+
+- (void)inkPickerDidChangeInk:(WKInkPicker *)inkPicker
+{
+ [self._focusedDrawingView didChangeInk:self.currentInk];
+}
+
- (void)installInkPickerForDrawing:(WebCore::GraphicsLayer::EmbeddedViewID)embeddedViewID
{
_focusedEmbeddedViewID = embeddedViewID;
- WKWebView *webView = _contentView->_webView;
+ if (!_inkPicker)
+ _inkPicker = adoptNS([[WKInkPicker alloc] initWithDelegate:self]);
+ [_inkPicker show];
- [_inkPicker sizeToFit];
- [_inkPicker setTranslatesAutoresizingMaskIntoConstraints:NO];
- [webView addSubview:_inkPicker.get()];
-
- [NSLayoutConstraint activateConstraints:@[
- [[_inkPicker heightAnchor] constraintEqualToConstant:[_inkPicker frame].size.height],
- [[_inkPicker bottomAnchor] constraintEqualToAnchor:webView.safeAreaLayoutGuide.bottomAnchor],
- [[_inkPicker leftAnchor] constraintEqualToAnchor:webView.safeAreaLayoutGuide.leftAnchor],
- [[_inkPicker rightAnchor] constraintEqualToAnchor:webView.safeAreaLayoutGuide.rightAnchor],
- ]];
-
// When focused, push the ruler state down to the canvas so that it doesn't get out of sync
// and early-return from later changes.
- [self._focusedDrawingView didChangeRulerState:[_inkPicker rulerEnabled]];
+ [self._focusedDrawingView didChangeRulerState:_rulerEnabled];
}
- (void)uninstallInkPicker
{
- [_inkPicker removeFromSuperview];
+ [_inkPicker hide];
+ [self._focusedDrawingView didChangeRulerState:NO];
_focusedEmbeddedViewID = 0;
}
Modified: trunk/Source/WebKit/UIProcess/ios/WKDrawingView.mm (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/WKDrawingView.mm 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/WKDrawingView.mm 2019-03-27 18:22:59 UTC (rev 243553)
@@ -31,7 +31,6 @@
#import "EditableImageController.h"
#import "WKContentViewInteraction.h"
#import "WKDrawingCoordinator.h"
-#import "WKInkPickerView.h"
#import <wtf/OSObjectPtr.h>
#import <wtf/RetainPtr.h>
@@ -173,7 +172,7 @@
- (void)_canvasViewWillBeginDrawing:(PKCanvasView *)canvasView
{
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
- [_pencilView setInk:_contentView._drawingCoordinator.inkPicker.ink];
+ [_pencilView setInk:_contentView._drawingCoordinator.currentInk];
ALLOW_DEPRECATED_DECLARATIONS_END
}
Deleted: trunk/Source/WebKit/UIProcess/ios/WKInkPickerView.h (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/WKInkPickerView.h 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/WKInkPickerView.h 2019-03-27 18:22:59 UTC (rev 243553)
@@ -1,46 +0,0 @@
-/*
- * 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.
- */
-
-#if HAVE(PENCILKIT)
-
-#import <UIKit/UIKit.h>
-
-OBJC_CLASS PKInk;
-OBJC_CLASS WKContentView;
-
-@interface WKInkPickerView : UIView
-
-- (instancetype)init NS_UNAVAILABLE;
-- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
-- (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
-
-- (instancetype)initWithContentView:(WKContentView *)contentView NS_DESIGNATED_INITIALIZER;
-
-@property (nonatomic) BOOL rulerEnabled;
-@property (nonatomic, retain) PKInk *ink;
-
-@end
-
-#endif // HAVE(PENCILKIT)
Deleted: trunk/Source/WebKit/UIProcess/ios/WKInkPickerView.mm (243552 => 243553)
--- trunk/Source/WebKit/UIProcess/ios/WKInkPickerView.mm 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/UIProcess/ios/WKInkPickerView.mm 2019-03-27 18:22:59 UTC (rev 243553)
@@ -1,115 +0,0 @@
-/*
- * 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 "WKInkPickerView.h"
-
-#if HAVE(PENCILKIT)
-
-#import "WKContentViewInteraction.h"
-#import "WKDrawingCoordinator.h"
-
-#import "PencilKitSoftLink.h"
-
-@interface WKInkPickerView () <PKInlineInkPickerDelegate>
-@end
-
-@implementation WKInkPickerView {
- RetainPtr<PKInlineInkPicker> _inlinePicker;
- __weak WKContentView *_contentView;
-}
-
-- (instancetype)initWithContentView:(WKContentView *)contentView
-{
- self = [super initWithFrame:CGRectZero];
- if (!self)
- return nil;
-
- _inlinePicker = adoptNS([WebKit::allocPKInlineInkPickerInstance() init]);
- [_inlinePicker setDelegate:self];
-
- _contentView = contentView;
- [self addSubview:_inlinePicker.get()];
-
- return self;
-}
-
-- (void)didPickInk
-{
- [_contentView._drawingCoordinator didChangeInk:[_inlinePicker selectedInk]];
-}
-
-- (void)inlineInkPickerDidToggleRuler:(PKInlineInkPicker *)inlineInkPicker
-{
- _rulerEnabled = !_rulerEnabled;
- [_contentView._drawingCoordinator didChangeRulerState:_rulerEnabled];
-}
-
-- (void)inlineInkPicker:(PKInlineInkPicker *)inlineInkPicker didSelectTool:(PKInkIdentifier)identifer
-{
- [self didPickInk];
-}
-
-- (void)inlineInkPicker:(PKInlineInkPicker *)inlineInkPicker didSelectColor:(UIColor *)color
-{
- [self didPickInk];
-}
-
-- (CGSize)inkPickerSize
-{
- CGSize keyboardSize = [UIKeyboard defaultSizeForInterfaceOrientation:[UIApp interfaceOrientation]];
- return [_inlinePicker sizeThatFits:keyboardSize];
-}
-
-- (void)layoutSubviews
-{
- CGSize pickerSize = self.inkPickerSize;
- [_inlinePicker setFrame:CGRectMake(CGRectGetMidX(self.bounds) - (pickerSize.width / 2), 0, pickerSize.width, pickerSize.height)];
-}
-
-- (CGSize)sizeThatFits:(CGSize)size
-{
- CGSize keyboardSize = [UIKeyboard defaultSizeForInterfaceOrientation:[UIApp interfaceOrientation]];
- return CGSizeMake(keyboardSize.width, self.inkPickerSize.height);
-}
-
-- (UIViewController *)viewControllerForPopoverPresentationFromInlineInkPicker:(PKInlineInkPicker *)inlineInkPicker
-{
- return [UIViewController _viewControllerForFullScreenPresentationFromView:_contentView];
-}
-
-- (void)setInk:(PKInk *)ink
-{
- [_inlinePicker setSelectedInk:ink];
-}
-
-- (PKInk *)ink
-{
- return [_inlinePicker selectedInk];
-}
-
-@end
-
-#endif // HAVE(PENCILKIT)
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (243552 => 243553)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-03-27 18:22:24 UTC (rev 243552)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-03-27 18:22:59 UTC (rev 243553)
@@ -2810,8 +2810,6 @@
2DE9B1382231F61C005287B7 /* _WKTextInputContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKTextInputContext.h; sourceTree = "<group>"; };
2DE9B13B2231F77C005287B7 /* _WKTextInputContextInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKTextInputContextInternal.h; sourceTree = "<group>"; };
2DEAC5CE1AC368BB00A195D8 /* _WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKFindOptions.h; sourceTree = "<group>"; };
- 2DF3962A21C8DC50008835E3 /* WKInkPickerView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKInkPickerView.mm; path = ios/WKInkPickerView.mm; sourceTree = "<group>"; };
- 2DF3962B21C8DC50008835E3 /* WKInkPickerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKInkPickerView.h; path = ios/WKInkPickerView.h; sourceTree = "<group>"; };
2DF9593418A42412009785A1 /* ViewGestureControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ViewGestureControllerIOS.mm; path = ios/ViewGestureControllerIOS.mm; sourceTree = "<group>"; };
2DF9EEE31A781FB400B6CFBE /* APIFrameInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIFrameInfo.cpp; sourceTree = "<group>"; };
2DF9EEE41A781FB400B6CFBE /* APIFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIFrameInfo.h; sourceTree = "<group>"; };
@@ -5923,8 +5921,6 @@
0FCB4E4118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm */,
933DF82D1B3BC09000AEA9E3 /* WKImagePreviewViewController.h */,
933DF82F1B3BC0B400AEA9E3 /* WKImagePreviewViewController.mm */,
- 2DF3962B21C8DC50008835E3 /* WKInkPickerView.h */,
- 2DF3962A21C8DC50008835E3 /* WKInkPickerView.mm */,
0F3C7259196F5F6800AEDD0C /* WKInspectorHighlightView.h */,
0F3C7257196F5F5000AEDD0C /* WKInspectorHighlightView.mm */,
A54293A2195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.h */,