WebKit Bugzilla
Attachment 372984 Details for
Bug 199255
: Add type to UIImage symbol mapping for _WKElementAction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199255-20190627111137.patch (text/plain), 5.53 KB, created by
Dean Jackson
on 2019-06-26 18:11:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2019-06-26 18:11:39 PDT
Size:
5.53 KB
patch
obsolete
>Subversion Revision: 246800 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2c6ab260abeeda3f47271e415acddf2507ddfc0b..772f5a5ae679fa4d1345ed2125bb8a5a1d8f8198 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2019-06-26 Dean Jackson <dino@apple.com> >+ >+ Add type to UIImage symbol mapping for _WKElementAction >+ https://bugs.webkit.org/show_bug.cgi?id=199255 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Moving some code in from WebKitAdditions now >+ that the API is public. >+ >+ * UIProcess/API/Cocoa/_WKElementAction.mm: >+ (+[_WKElementAction imageForElementActionType:]): >+ (elementActionTypeToUIActionIdentifier): >+ (uiActionIdentifierToElementActionType): >+ > 2019-06-26 Dean Jackson <dino@apple.com> > > Expose UIAction identifiers for _WKElementActions >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm b/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm >index 5cc2adcf3bdca84a34f7348ae4eb63dc6d8cc1b2..f58e1425a7f515d7f64a3232f30ea317787c254c 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm >@@ -38,10 +38,6 @@ > #import <wtf/WeakObjCPtr.h> > #import <wtf/text/WTFString.h> > >-#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.h>) >-#include <WebKitAdditions/WKElementActionAdditions.h> >-#endif >- > #if HAVE(SAFARI_SERVICES_FRAMEWORK) > #import <SafariServices/SSReadingList.h> > SOFT_LINK_FRAMEWORK(SafariServices); >@@ -193,16 +189,35 @@ static void addToReadingList(NSURL *targetURL, NSString *title) > [self _runActionWithElementInfo:info forActionSheetAssistant:_defaultActionSheetAssistant.get().get()]; > } > >-#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.mm>) >-#include <WebKitAdditions/WKElementActionAdditions.mm> >-#else >+#if USE(UICONTEXTMENU) > + (UIImage *)imageForElementActionType:(_WKElementActionType)actionType > { >- return nil; >+ switch (actionType) { >+ case _WKElementActionTypeCustom: >+ return nil; >+ case _WKElementActionTypeOpen: >+ return [UIImage systemImageNamed:@"safari"]; >+ case _WKElementActionTypeCopy: >+ return [UIImage systemImageNamed:@"doc.on.doc"]; >+ case _WKElementActionTypeSaveImage: >+ return [UIImage systemImageNamed:@"square.and.arrow.down"]; >+ case _WKElementActionTypeAddToReadingList: >+ return [UIImage systemImageNamed:@"eyeglasses"]; >+ case _WKElementActionTypeOpenInDefaultBrowser: >+ return [UIImage systemImageNamed:@"safari"]; >+ case _WKElementActionTypeOpenInExternalApplication: >+ return [UIImage systemImageNamed:@"arrow.up.right.square"]; >+ case _WKElementActionTypeShare: >+ return [UIImage systemImageNamed:@"square.and.arrow.up"]; >+ case _WKElementActionTypeOpenInNewTab: >+ return [UIImage systemImageNamed:@"plus.square.on.square"]; >+ case _WKElementActionTypeOpenInNewWindow: >+ return [UIImage systemImageNamed:@"square.grid.2x2"]; >+ case _WKElementActionTypeDownload: >+ return [UIImage systemImageNamed:@"arrow.down.circle"]; >+ } > } >-#endif > >-#if USE(UICONTEXTMENU) > static UIActionIdentifier elementActionTypeToUIActionIdentifier(_WKElementActionType actionType) > { > switch (actionType) { >@@ -214,14 +229,12 @@ static UIActionIdentifier elementActionTypeToUIActionIdentifier(_WKElementAction > return WKElementActionTypeCopyIdentifier; > case _WKElementActionTypeSaveImage: > return WKElementActionTypeSaveImageIdentifier; >-#if !defined(TARGET_OS_IOS) || TARGET_OS_IOS > case _WKElementActionTypeAddToReadingList: > return WKElementActionTypeAddToReadingListIdentifier; > case _WKElementActionTypeOpenInDefaultBrowser: > return WKElementActionTypeOpenInDefaultBrowserIdentifier; > case _WKElementActionTypeOpenInExternalApplication: > return WKElementActionTypeOpenInExternalApplicationIdentifier; >-#endif > case _WKElementActionTypeShare: > return WKElementActionTypeShareIdentifier; > case _WKElementActionTypeOpenInNewTab: >@@ -243,14 +256,12 @@ static _WKElementActionType uiActionIdentifierToElementActionType(UIActionIdenti > return _WKElementActionTypeCopy; > if ([identifier isEqualToString:WKElementActionTypeSaveImageIdentifier]) > return _WKElementActionTypeSaveImage; >-#if !defined(TARGET_OS_IOS) || TARGET_OS_IOS > if ([identifier isEqualToString:WKElementActionTypeAddToReadingListIdentifier]) > return _WKElementActionTypeAddToReadingList; > if ([identifier isEqualToString:WKElementActionTypeOpenInDefaultBrowserIdentifier]) > return _WKElementActionTypeOpenInDefaultBrowser; > if ([identifier isEqualToString:WKElementActionTypeOpenInExternalApplicationIdentifier]) > return _WKElementActionTypeOpenInExternalApplication; >-#endif > if ([identifier isEqualToString:WKElementActionTypeShareIdentifier]) > return _WKElementActionTypeShare; > if ([identifier isEqualToString:WKElementActionTypeOpenInNewTabIdentifier]) >@@ -284,6 +295,11 @@ static _WKElementActionType uiActionIdentifierToElementActionType(UIActionIdenti > }]; > } > #else >++ (UIImage *)imageForElementActionType:(_WKElementActionType)actionType >+{ >+ return nil; >+} >+ > + (_WKElementActionType)elementActionTypeForUIActionIdentifier:(UIActionIdentifier)identifier > { > return _WKElementActionTypeCustom; >@@ -293,7 +309,7 @@ static _WKElementActionType uiActionIdentifierToElementActionType(UIActionIdenti > { > return nil; > } >-#endif >+#endif // USE(UICONTEXTMENU) > > @end >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
sam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199255
: 372984