⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 295177 in webkit


Ignore:
Timestamp:
Jun 2, 2022, 11:45:11 PM (4 years ago)
Author:
Alan Coon
Message:

Cherry-pick 21a843f63576. 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

Location:
branches/safari-613-branch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613-branch/Source/WebCore/PAL/ChangeLog

    r294066 r295177  
     12022-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] [WK2] Managed pasteboard should function for all managed domains
     4        https://bugs.webkit.org/show_bug.cgi?id=239319
     5        rdar://80059355
     6
     7        Reviewed by Kate Cheney.
     8
     9        Add an SPI method on `MCProfileConnection`.
     10
     11        * pal/spi/ios/ManagedConfigurationSPI.h:
     12
    1132022-04-19  Alan Coon  <alancoon@apple.com>
    214
  • branches/safari-613-branch/Source/WebKit/ChangeLog

    r295176 r295177  
     12022-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] [WK2] Managed pasteboard should function for all managed domains
     4        https://bugs.webkit.org/show_bug.cgi?id=239319
     5        rdar://80059355
     6
     7        Reviewed by Kate Cheney.
     8
     9        Unless a WebKit client has specified a data owner for the web view that is not _UIDataOwnerUndefined, fall back
     10        to _UIDataOwnerEnterprise when the current domain of the WKWebView is managed (that is, `-[MCProfileConnection
     11        isURLManaged:]` returns YES for the web view's current URL). This allows managed pasteboard to work for all
     12        WebKit clients, if the current URL is managed.
     13
     14        Test: UIPasteboardTests.PerformAsDataOwnerWithManagedURL
     15
     16        * Platform/spi/ios/UIKitSPI.h:
     17
     18        Drive-by fix: move the staged declarations of `-_dataOwnerForCopy` and `-_dataOwnerForPaste` out of the IPI
     19        section, and into the non-internal SDK section.
     20
     21        * UIProcess/ios/WKContentViewInteraction.mm:
     22        (-[WKContentView _dataOwnerForPasteboard:]):
     23
    1242022-04-22  Kimmo Kinnunen  <kkinnunen@apple.com>
    225
  • branches/safari-613-branch/Tools/ChangeLog

    r295174 r295177  
     12022-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] [WK2] Managed pasteboard should function for all managed domains
     4        https://bugs.webkit.org/show_bug.cgi?id=239319
     5        rdar://80059355
     6
     7        Reviewed by Kate Cheney.
     8
     9        Add a new API test to verify that we fall back to consulting `-[MCProfileConnection isURLManaged:]` when
     10        determining the data owner for copy and paste, unless a data owner is already explicitly set on a view in the
     11        responder chain (specifically, the WKWebView).
     12
     13        * TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
     14        (+[TestUIPasteboard _performAsDataOwner:block:]):
     15        (-[TestMCProfileConnection isURLManaged:]):
     16        (TestWebKitAPI::TEST):
     17
    1182022-04-22  Kimmo Kinnunen  <kkinnunen@apple.com>
    219
Note: See TracChangeset for help on using the changeset viewer.