Diff
Modified: branches/safari-613-branch/Source/WebCore/PAL/ChangeLog (294065 => 294066)
--- branches/safari-613-branch/Source/WebCore/PAL/ChangeLog 2022-05-11 20:20:20 UTC (rev 294065)
+++ branches/safari-613-branch/Source/WebCore/PAL/ChangeLog 2022-05-11 20:25:33 UTC (rev 294066)
@@ -1,62 +1,3 @@
-2022-05-06 Alan Coon <[email protected]>
-
- Cherry-pick r292888. rdar://problem/80059355
-
- [iOS] [WK2] Managed pasteboard should function for all managed domains
- https://bugs.webkit.org/show_bug.cgi?id=239319
- rdar://80059355
-
- Reviewed by Kate Cheney.
-
- Source/WebCore/PAL:
-
- Add an SPI method on `MCProfileConnection`.
-
- * pal/spi/ios/ManagedConfigurationSPI.h:
-
- Source/WebKit:
-
- Unless a WebKit client has specified a data owner for the web view that is not _UIDataOwnerUndefined, fall back
- to _UIDataOwnerEnterprise when the current domain of the WKWebView is managed (that is, `-[MCProfileConnection
- isURLManaged:]` returns YES for the web view's current URL). This allows managed pasteboard to work for all
- WebKit clients, if the current URL is managed.
-
- Test: UIPasteboardTests.PerformAsDataOwnerWithManagedURL
-
- * Platform/spi/ios/UIKitSPI.h:
-
- Drive-by fix: move the staged declarations of `-_dataOwnerForCopy` and `-_dataOwnerForPaste` out of the IPI
- section, and into the non-internal SDK section.
-
- * UIProcess/ios/WKContentViewInteraction.mm:
- (-[WKContentView _dataOwnerForPasteboard:]):
-
- Tools:
-
- Add a new API test to verify that we fall back to consulting `-[MCProfileConnection isURLManaged:]` when
- determining the data owner for copy and paste, unless a data owner is already explicitly set on a view in the
- responder chain (specifically, the WKWebView).
-
- * TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
- (+[TestUIPasteboard _performAsDataOwner:block:]):
- (-[TestMCProfileConnection isURLManaged:]):
- (TestWebKitAPI::TEST):
-
- Canonical link: https://commits.webkit.org/249658@main
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2022-04-14 Wenson Hsieh <[email protected]>
-
- [iOS] [WK2] Managed pasteboard should function for all managed domains
- https://bugs.webkit.org/show_bug.cgi?id=239319
- rdar://80059355
-
- Reviewed by Kate Cheney.
-
- Add an SPI method on `MCProfileConnection`.
-
- * pal/spi/ios/ManagedConfigurationSPI.h:
-
2022-04-19 Alan Coon <[email protected]>
Cherry-pick r290997. rdar://problem/79950080
Modified: branches/safari-613-branch/Source/WebCore/PAL/pal/spi/ios/ManagedConfigurationSPI.h (294065 => 294066)
--- branches/safari-613-branch/Source/WebCore/PAL/pal/spi/ios/ManagedConfigurationSPI.h 2022-05-11 20:20:20 UTC (rev 294065)
+++ branches/safari-613-branch/Source/WebCore/PAL/pal/spi/ios/ManagedConfigurationSPI.h 2022-05-11 20:25:33 UTC (rev 294066)
@@ -56,12 +56,9 @@
@interface MCProfileConnection : NSObject
@end
-@class NSURL;
-
@interface MCProfileConnection ()
+ (MCProfileConnection *)sharedConnection;
- (MCRestrictedBoolType)effectiveBoolValueForSetting:(NSString *)feature;
-- (BOOL)isURLManaged:(NSURL *)url;
@end
#endif
Modified: branches/safari-613-branch/Source/WebKit/ChangeLog (294065 => 294066)
--- branches/safari-613-branch/Source/WebKit/ChangeLog 2022-05-11 20:20:20 UTC (rev 294065)
+++ branches/safari-613-branch/Source/WebKit/ChangeLog 2022-05-11 20:25:33 UTC (rev 294066)
@@ -1,73 +1,3 @@
-2022-05-06 Alan Coon <[email protected]>
-
- Cherry-pick r292888. rdar://problem/80059355
-
- [iOS] [WK2] Managed pasteboard should function for all managed domains
- https://bugs.webkit.org/show_bug.cgi?id=239319
- rdar://80059355
-
- Reviewed by Kate Cheney.
-
- Source/WebCore/PAL:
-
- Add an SPI method on `MCProfileConnection`.
-
- * pal/spi/ios/ManagedConfigurationSPI.h:
-
- Source/WebKit:
-
- Unless a WebKit client has specified a data owner for the web view that is not _UIDataOwnerUndefined, fall back
- to _UIDataOwnerEnterprise when the current domain of the WKWebView is managed (that is, `-[MCProfileConnection
- isURLManaged:]` returns YES for the web view's current URL). This allows managed pasteboard to work for all
- WebKit clients, if the current URL is managed.
-
- Test: UIPasteboardTests.PerformAsDataOwnerWithManagedURL
-
- * Platform/spi/ios/UIKitSPI.h:
-
- Drive-by fix: move the staged declarations of `-_dataOwnerForCopy` and `-_dataOwnerForPaste` out of the IPI
- section, and into the non-internal SDK section.
-
- * UIProcess/ios/WKContentViewInteraction.mm:
- (-[WKContentView _dataOwnerForPasteboard:]):
-
- Tools:
-
- Add a new API test to verify that we fall back to consulting `-[MCProfileConnection isURLManaged:]` when
- determining the data owner for copy and paste, unless a data owner is already explicitly set on a view in the
- responder chain (specifically, the WKWebView).
-
- * TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
- (+[TestUIPasteboard _performAsDataOwner:block:]):
- (-[TestMCProfileConnection isURLManaged:]):
- (TestWebKitAPI::TEST):
-
- Canonical link: https://commits.webkit.org/249658@main
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2022-04-14 Wenson Hsieh <[email protected]>
-
- [iOS] [WK2] Managed pasteboard should function for all managed domains
- https://bugs.webkit.org/show_bug.cgi?id=239319
- rdar://80059355
-
- Reviewed by Kate Cheney.
-
- Unless a WebKit client has specified a data owner for the web view that is not _UIDataOwnerUndefined, fall back
- to _UIDataOwnerEnterprise when the current domain of the WKWebView is managed (that is, `-[MCProfileConnection
- isURLManaged:]` returns YES for the web view's current URL). This allows managed pasteboard to work for all
- WebKit clients, if the current URL is managed.
-
- Test: UIPasteboardTests.PerformAsDataOwnerWithManagedURL
-
- * Platform/spi/ios/UIKitSPI.h:
-
- Drive-by fix: move the staged declarations of `-_dataOwnerForCopy` and `-_dataOwnerForPaste` out of the IPI
- section, and into the non-internal SDK section.
-
- * UIProcess/ios/WKContentViewInteraction.mm:
- (-[WKContentView _dataOwnerForPasteboard:]):
-
2022-05-02 Alan Coon <[email protected]>
Apply patch. rdar://problem/92617943
Modified: branches/safari-613-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h (294065 => 294066)
--- branches/safari-613-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2022-05-11 20:20:20 UTC (rev 294065)
+++ branches/safari-613-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2022-05-11 20:25:33 UTC (rev 294066)
@@ -163,13 +163,6 @@
UIPreviewItemTypeAttachment,
};
-typedef NS_ENUM(NSInteger, _UIDataOwner) {
- _UIDataOwnerUndefined,
- _UIDataOwnerUser,
- _UIDataOwnerEnterprise,
- _UIDataOwnerShared,
-};
-
@class UIPreviewItemController;
@protocol UIPreviewItemDelegate <NSObject>
@@ -478,10 +471,7 @@
- (void)_wheelChangedWithEvent:(UIEvent *)event;
- (void)_beginPinningInputViews;
- (void)_endPinningInputViews;
-#if HAVE(PASTEBOARD_DATA_OWNER)
-@property (nonatomic, setter=_setDataOwnerForCopy:) _UIDataOwner _dataOwnerForCopy;
-@property (nonatomic, setter=_setDataOwnerForPaste:) _UIDataOwner _dataOwnerForPaste;
-#endif
+
@end
@class FBSDisplayConfiguration;
@@ -1354,6 +1344,15 @@
#define UIWKDocumentRequestMarkedTextRects (1 << 5)
#define UIWKDocumentRequestSpatialAndCurrentSelection (1 << 6)
+#if HAVE(PASTEBOARD_DATA_OWNER)
+
+@interface UIResponder (Staging_73852335)
+@property (nonatomic, setter=_setDataOwnerForCopy:) _UIDataOwner _dataOwnerForCopy;
+@property (nonatomic, setter=_setDataOwnerForPaste:) _UIDataOwner _dataOwnerForPaste;
+@end
+
+#endif
+
@interface UITextInteractionAssistant (IPI)
@property (nonatomic, readonly) BOOL inGesture;
@property (nonatomic, readonly) UITextInteraction *interactions;
Modified: branches/safari-613-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (294065 => 294066)
--- branches/safari-613-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2022-05-11 20:20:20 UTC (rev 294065)
+++ branches/safari-613-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2022-05-11 20:25:33 UTC (rev 294066)
@@ -7878,23 +7878,18 @@
- (WebCore::DataOwnerType)_dataOwnerForPasteboard:(WebKit::PasteboardAccessIntent)intent
{
- auto specifiedType = [&] {
- if (intent == WebKit::PasteboardAccessIntent::Read)
- return coreDataOwnerType(self._dataOwnerForPaste);
-
- if (intent == WebKit::PasteboardAccessIntent::Write)
- return coreDataOwnerType(self._dataOwnerForCopy);
-
- ASSERT_NOT_REACHED();
+ if (![self respondsToSelector:@selector(_dataOwnerForPaste)]) {
+ // FIXME: Remove this once the relevant bots have fix for <rdar://problem/73852335>.
return WebCore::DataOwnerType::Undefined;
- }();
+ }
- if (specifiedType != WebCore::DataOwnerType::Undefined)
- return specifiedType;
+ if (intent == WebKit::PasteboardAccessIntent::Read)
+ return coreDataOwnerType(self._dataOwnerForPaste);
- if ([[PAL::getMCProfileConnectionClass() sharedConnection] isURLManaged:[_webView URL]])
- return WebCore::DataOwnerType::Enterprise;
+ if (intent == WebKit::PasteboardAccessIntent::Write)
+ return coreDataOwnerType(self._dataOwnerForCopy);
+ ASSERT_NOT_REACHED();
return WebCore::DataOwnerType::Undefined;
}
Modified: branches/safari-613-branch/Tools/ChangeLog (294065 => 294066)
--- branches/safari-613-branch/Tools/ChangeLog 2022-05-11 20:20:20 UTC (rev 294065)
+++ branches/safari-613-branch/Tools/ChangeLog 2022-05-11 20:25:33 UTC (rev 294066)
@@ -1,67 +1,3 @@
-2022-05-06 Alan Coon <[email protected]>
-
- Cherry-pick r292888. rdar://problem/80059355
-
- [iOS] [WK2] Managed pasteboard should function for all managed domains
- https://bugs.webkit.org/show_bug.cgi?id=239319
- rdar://80059355
-
- Reviewed by Kate Cheney.
-
- Source/WebCore/PAL:
-
- Add an SPI method on `MCProfileConnection`.
-
- * pal/spi/ios/ManagedConfigurationSPI.h:
-
- Source/WebKit:
-
- Unless a WebKit client has specified a data owner for the web view that is not _UIDataOwnerUndefined, fall back
- to _UIDataOwnerEnterprise when the current domain of the WKWebView is managed (that is, `-[MCProfileConnection
- isURLManaged:]` returns YES for the web view's current URL). This allows managed pasteboard to work for all
- WebKit clients, if the current URL is managed.
-
- Test: UIPasteboardTests.PerformAsDataOwnerWithManagedURL
-
- * Platform/spi/ios/UIKitSPI.h:
-
- Drive-by fix: move the staged declarations of `-_dataOwnerForCopy` and `-_dataOwnerForPaste` out of the IPI
- section, and into the non-internal SDK section.
-
- * UIProcess/ios/WKContentViewInteraction.mm:
- (-[WKContentView _dataOwnerForPasteboard:]):
-
- Tools:
-
- Add a new API test to verify that we fall back to consulting `-[MCProfileConnection isURLManaged:]` when
- determining the data owner for copy and paste, unless a data owner is already explicitly set on a view in the
- responder chain (specifically, the WKWebView).
-
- * TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
- (+[TestUIPasteboard _performAsDataOwner:block:]):
- (-[TestMCProfileConnection isURLManaged:]):
- (TestWebKitAPI::TEST):
-
- Canonical link: https://commits.webkit.org/249658@main
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2022-04-14 Wenson Hsieh <[email protected]>
-
- [iOS] [WK2] Managed pasteboard should function for all managed domains
- https://bugs.webkit.org/show_bug.cgi?id=239319
- rdar://80059355
-
- Reviewed by Kate Cheney.
-
- Add a new API test to verify that we fall back to consulting `-[MCProfileConnection isURLManaged:]` when
- determining the data owner for copy and paste, unless a data owner is already explicitly set on a view in the
- responder chain (specifically, the WKWebView).
-
- * TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
- (+[TestUIPasteboard _performAsDataOwner:block:]):
- (-[TestMCProfileConnection isURLManaged:]):
- (TestWebKitAPI::TEST):
-
2022-04-22 Alan Coon <[email protected]>
Cherry-pick r292274. rdar://problem/80544133
Modified: branches/safari-613-branch/Tools/TestWebKitAPI/Tests/ios/UIPasteboardTests.mm (294065 => 294066)
--- branches/safari-613-branch/Tools/TestWebKitAPI/Tests/ios/UIPasteboardTests.mm 2022-05-11 20:20:20 UTC (rev 294065)
+++ branches/safari-613-branch/Tools/TestWebKitAPI/Tests/ios/UIPasteboardTests.mm 2022-05-11 20:25:33 UTC (rev 294066)
@@ -28,7 +28,6 @@
#if PLATFORM(IOS_FAMILY)
#import "ClassMethodSwizzler.h"
-#import "InstanceMethodSwizzler.h"
#import "PlatformUtilities.h"
#import "TestWKWebView.h"
#import "UIKitSPI.h"
@@ -36,7 +35,7 @@
#import <UIKit/UIPasteboard.h>
#import <WebKit/WKPreferencesPrivate.h>
#import <WebKit/WKWebViewPrivate.h>
-#import <pal/ios/ManagedConfigurationSoftLink.h>
+#import <wtf/SoftLinking.h>
typedef void (^DataLoadCompletionBlock)(NSData *, NSError *);
@@ -68,18 +67,6 @@
@end
-@interface TestMCProfileConnection : NSObject
-@end
-
-@implementation TestMCProfileConnection
-
-- (BOOL)isURLManaged:(NSURL *)url
-{
- return [url.lastPathComponent isEqualToString:@"simple.html"];
-}
-
-@end
-
#endif // HAVE(PASTEBOARD_DATA_OWNER)
#endif // PLATFORM(IOS)
@@ -424,36 +411,6 @@
EXPECT_WK_STREQ([webView contentsAsString], "Foo bar\n");
}
-TEST(UIPasteboardTests, PerformAsDataOwnerWithManagedURL)
-{
- auto pasteboardSwizzler = ClassMethodSwizzler {
- UIPasteboard.class,
- @selector(_performAsDataOwner:block:),
- [TestUIPasteboard methodForSelector:@selector(_performAsDataOwner:block:)]
- };
-
- auto managedConfigurationSwizzler = InstanceMethodSwizzler {
- PAL::getMCProfileConnectionClass(),
- @selector(isURLManaged:),
- [TestMCProfileConnection instanceMethodForSelector:@selector(isURLManaged:)]
- };
-
- {
- auto source = setUpWebViewForPasteboardTests(@"simple");
- [source selectAll:nil];
- [source copy:nil];
- [source waitForNextPresentationUpdate];
- EXPECT_EQ(gLastKnownDataOwner, _UIDataOwnerEnterprise);
- }
- {
- auto destination = setUpWebViewForPasteboardTests(@"autofocus-contenteditable");
- [destination _setDataOwnerForPaste:_UIDataOwnerUser];
- [destination paste:nil];
- [destination waitForNextPresentationUpdate];
- EXPECT_EQ(gLastKnownDataOwner, _UIDataOwnerUser);
- }
-}
-
#endif // HAVE(PASTEBOARD_DATA_OWNER)
#endif // PLATFORM(IOS)