[iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Dec 2018 05:07:01 +0000 (05:07 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Dec 2018 05:07:01 +0000 (05:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193019

Reviewed by Dan Bernstein.

Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
of these methods; after <rdar://problem/46047546>, they have moved to the underscore-prefixed versions, so we
we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
changes to WKWebViewPrivate.h.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView canPerformAction:withSender:]):
(-[WKWebView targetForAction:withSender:]):
(-[WKWebView _setFont:sender:]):
(-[WKWebView _setFontSize:sender:]):
(-[WKWebView _setTextColor:sender:]):
(-[WKWebView setFont:sender:]): Deleted.
(-[WKWebView setTextColor:sender:]): Deleted.
(-[WKWebView setFontSize:sender:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView setFontForWebView:sender:]): Deleted.
(-[WKContentView setFontSizeForWebView:sender:]): Deleted.
(-[WKContentView setTextColorForWebView:sender:]): Deleted.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index 57623fa..effac72 100644 (file)
@@ -1,5 +1,35 @@
 2018-12-23  Wenson Hsieh  <wenson_hsieh@apple.com>
 
+        [iOS] Remove some unnecessary editing SPI after <rdar://problem/46047546>
+        https://bugs.webkit.org/show_bug.cgi?id=193019
+
+        Reviewed by Dan Bernstein.
+
+        Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee
+        of these methods; after <rdar://problem/46047546>, they have moved to the underscore-prefixed versions, so we
+        we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this
+        through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these
+        changes to WKWebViewPrivate.h.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView canPerformAction:withSender:]):
+        (-[WKWebView targetForAction:withSender:]):
+        (-[WKWebView _setFont:sender:]):
+        (-[WKWebView _setFontSize:sender:]):
+        (-[WKWebView _setTextColor:sender:]):
+        (-[WKWebView setFont:sender:]): Deleted.
+        (-[WKWebView setTextColor:sender:]): Deleted.
+        (-[WKWebView setFontSize:sender:]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView canPerformActionForWebView:withSender:]):
+        (-[WKContentView setFontForWebView:sender:]): Deleted.
+        (-[WKContentView setFontSizeForWebView:sender:]): Deleted.
+        (-[WKContentView setTextColorForWebView:sender:]): Deleted.
+
+2018-12-23  Wenson Hsieh  <wenson_hsieh@apple.com>
+
         Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543
         https://bugs.webkit.org/show_bug.cgi?id=193015
         <rdar://problem/46583527>
index 2b4de5c..6d89396 100644 (file)
@@ -1445,9 +1445,6 @@ FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_ACTION_TO_WKCONTENTVIEW)
 
     FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW)
     FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW)
-    FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(setTextColor:sender)
-    FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(setFontSize:sender)
-    FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(setFont:sender)
     FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(_setTextColor:sender)
     FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(_setFontSize:sender)
     FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(_setFont:sender)
@@ -1465,9 +1462,6 @@ FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_ACTION_TO_WKCONTENTVIEW)
 
     FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW)
     FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW)
-    FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(setTextColor:sender)
-    FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(setFontSize:sender)
-    FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(setFont:sender)
     FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(_setTextColor:sender)
     FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(_setFontSize:sender)
     FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(_setFont:sender)
@@ -1477,21 +1471,6 @@ FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_ACTION_TO_WKCONTENTVIEW)
     return [super targetForAction:action withSender:sender];
 }
 
-- (void)setFont:(UIFont *)font sender:(id)sender
-{
-    [_contentView setFontForWebView:font sender:sender];
-}
-
-- (void)setTextColor:(UIColor *)color sender:(id)sender
-{
-    [_contentView setTextColorForWebView:color sender:sender];
-}
-
-- (void)setFontSize:(CGFloat)fontSize sender:(id)sender
-{
-    [_contentView setFontSizeForWebView:fontSize sender:sender];
-}
-
 static inline CGFloat floorToDevicePixel(CGFloat input, float deviceScaleFactor)
 {
     return CGFloor(input * deviceScaleFactor) / deviceScaleFactor;
@@ -4432,19 +4411,19 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(FORWARD_ACTION_TO_WKCONTENTVIEW)
 - (void)_setFont:(UIFont *)font sender:(id)sender
 {
     if (self.usesStandardContentView)
-        [_contentView setFontForWebView:font sender:sender];
+        [_contentView _setFontForWebView:font sender:sender];
 }
 
 - (void)_setFontSize:(CGFloat)fontSize sender:(id)sender
 {
     if (self.usesStandardContentView)
-        [_contentView setFontSizeForWebView:fontSize sender:sender];
+        [_contentView _setFontSizeForWebView:fontSize sender:sender];
 }
 
 - (void)_setTextColor:(UIColor *)color sender:(id)sender
 {
     if (self.usesStandardContentView)
-        [_contentView setTextColorForWebView:color sender:sender];
+        [_contentView _setTextColorForWebView:color sender:sender];
 }
 
 #endif // PLATFORM(IOS_FAMILY)
index 8af852e..88b5635 100644 (file)
@@ -406,19 +406,6 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) {
 #if TARGET_OS_IPHONE
 
 @interface WKWebView () <UIResponderStandardEditActions>
-// FIXME: Remove these once internal clients have moved to the underscore-prefixed versions.
-- (void)alignCenter:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)alignJustified:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)alignLeft:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)alignRight:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)indent:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)insertOrderedList:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)insertUnorderedList:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)outdent:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)toggleStrikeThrough:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)setFont:(UIFont *)font sender:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)setFontSize:(CGFloat)fontSize sender:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
-- (void)setTextColor:(UIColor *)color sender:(id)sender WK_API_AVAILABLE(ios(WK_IOS_TBA));
 @end
 
 #else
index d91a585..7cc65fb 100644 (file)
@@ -129,15 +129,6 @@ typedef std::pair<WebKit::InteractionInformationRequest, InteractionInformationC
     M(toggleUnderline) \
     M(increaseSize) \
     M(decreaseSize) \
-    M(toggleStrikeThrough) \
-    M(insertUnorderedList) \
-    M(insertOrderedList) \
-    M(indent) \
-    M(outdent) \
-    M(alignLeft) \
-    M(alignRight) \
-    M(alignCenter) \
-    M(alignJustified) \
     M(pasteAndMatchStyle) \
     M(makeTextWritingDirectionNatural)
 
@@ -380,9 +371,9 @@ FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
 FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
 #undef DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW
 
-- (void)setFontForWebView:(UIFont *)fontFamily sender:(id)sender;
-- (void)setFontSizeForWebView:(CGFloat)fontSize sender:(id)sender;
-- (void)setTextColorForWebView:(UIColor *)color sender:(id)sender;
+- (void)_setFontForWebView:(UIFont *)fontFamily sender:(id)sender;
+- (void)_setFontSizeForWebView:(CGFloat)fontSize sender:(id)sender;
+- (void)_setTextColorForWebView:(UIColor *)color sender:(id)sender;
 
 #if ENABLE(TOUCH_EVENTS)
 - (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
index b71543c..cdfe5db 100644 (file)
@@ -2453,21 +2453,6 @@ WEBCORE_COMMAND_FOR_WEBVIEW(pasteAndMatchStyle);
     [self _toggleStrikeThroughForWebView:sender];
 }
 
-- (void)setFontForWebView:(UIFont *)font sender:(id)sender
-{
-    [self _setFontForWebView:font sender:sender];
-}
-
-- (void)setFontSizeForWebView:(CGFloat)fontSize sender:(id)sender
-{
-    [self _setFontSizeForWebView:fontSize sender:sender];
-}
-
-- (void)setTextColorForWebView:(UIColor *)color sender:(id)sender
-{
-    [self _setTextColorForWebView:color sender:sender];
-}
-
 - (NSDictionary *)textStylingAtPosition:(UITextPosition *)position inDirection:(UITextStorageDirection)direction
 {
     if (!position || !_page->editorState().isContentRichlyEditable)
@@ -2561,11 +2546,7 @@ WEBCORE_COMMAND_FOR_WEBVIEW(pasteAndMatchStyle);
         || action == @selector(_setTextColor:sender:) || action == @selector(_setFont:sender:) || action == @selector(_setFontSize:sender:)
         || action == @selector(_insertOrderedList:) || action == @selector(_insertUnorderedList:) || action == @selector(_insertNestedOrderedList:) || action == @selector(_insertNestedUnorderedList:)
         || action == @selector(_increaseListLevel:) || action == @selector(_decreaseListLevel:) || action == @selector(_changeListType:) || action == @selector(_indent:) || action == @selector(_outdent:)
-        || action == @selector(increaseSize:) || action == @selector(decreaseSize:)
-        || action == @selector(toggleStrikeThrough:) || action == @selector(insertOrderedList:) || action == @selector(insertUnorderedList:) || action == @selector(indent:) || action == @selector(outdent:)
-        || action == @selector(alignLeft:) || action == @selector(alignRight:) || action == @selector(alignCenter:) || action == @selector(alignJustified:)
-        || action == @selector(setTextColor:sender:) || action == @selector(setFont:sender:) || action == @selector(setFontSize:sender:)
-        || action == @selector(makeTextWritingDirectionNatural:)) {
+        || action == @selector(increaseSize:) || action == @selector(decreaseSize:) || action == @selector(makeTextWritingDirectionNatural:)) {
         // FIXME: This should be more nuanced in the future, rather than returning YES for all richly editable areas. For instance, outdent: should be disabled when the selection is already
         // at the outermost indentation level.
         return editorState.isContentRichlyEditable;