Bug 223919 - Promote WKWebView device orientation permission delegate to API
Summary: Promote WKWebView device orientation permission delegate to API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-30 04:19 PDT by youenn fablet
Modified: 2021-04-16 01:47 PDT (History)
4 users (show)

See Also:


Attachments
Patch (10.74 KB, patch)
2021-03-30 04:20 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (12.99 KB, patch)
2021-04-14 10:52 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (13.29 KB, patch)
2021-04-15 01:46 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (13.30 KB, patch)
2021-04-15 02:00 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (13.32 KB, patch)
2021-04-15 12:12 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (12.68 KB, patch)
2021-04-15 15:42 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2021-03-30 04:19:00 PDT
Promote WKWebView device orientation permission delegate to API
Comment 1 youenn fablet 2021-03-30 04:20:32 PDT
Created attachment 424628 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-04-06 04:19:51 PDT
<rdar://problem/76261609>
Comment 3 youenn fablet 2021-04-14 10:52:24 PDT
Created attachment 426013 [details]
Patch
Comment 4 youenn fablet 2021-04-14 10:53:42 PDT
<rdar://75998954>
Comment 5 youenn fablet 2021-04-15 01:46:55 PDT
Created attachment 426082 [details]
Patch
Comment 6 youenn fablet 2021-04-15 02:00:36 PDT
Created attachment 426086 [details]
Patch
Comment 7 youenn fablet 2021-04-15 02:31:45 PDT
@Keith, can you check why the script is not removing WK_UNAVAILABLE_API on TVOs and TVSim?
I do not have those builds locally.
Comment 8 Alex Christensen 2021-04-15 12:08:58 PDT
Comment on attachment 426086 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426086&action=review

> Source/WebKit/Scripts/postprocess-header-rule:77
>                  -e 's/WK_(API_|CLASS_)AVAILABLE\(.*\)\s*\)//g'
> +                -e 's/WK_API_UNAVAILABLE\(.*\)\s*\)//g'

WK_API_AVAILABLE needs to match two closing parentheses, whereas WK_API_UNAVAILABLE does not.  I fixed this by removing \s*\)
Comment 9 Alex Christensen 2021-04-15 12:09:44 PDT
Comment on attachment 426086 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426086&action=review

> Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:1078
> +    [(id <WKUIDelegatePrivate>)delegate webView:m_uiDelegate->m_webView.get().get() requestDeviceOrientationAndMotionPermissionForOrigin:wrapper(API::SecurityOrigin::create(securityOrigin.get())) initiatedByFrame:wrapper(API::FrameInfo::create(WTFMove(frameInfo), &page)) decisionHandler:decisionHandler.get()];

The cast to WKUIDelegatePrivate is no longer needed
Comment 10 Alex Christensen 2021-04-15 12:10:21 PDT
Comment on attachment 426086 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426086&action=review

> Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h:154
> +- (void)webView:(WKWebView *)webView requestDeviceOrientationAndMotionPermissionForOrigin:(WKSecurityOrigin*)origin initiatedByFrame:(WKFrameInfo *)frame decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA)) WK_API_UNAVAILABLE(macos);

Needs space between WKSecurityOrigin and *
Comment 11 Alex Christensen 2021-04-15 12:12:52 PDT
Created attachment 426124 [details]
Patch
Comment 12 Eric Carlson 2021-04-15 12:22:58 PDT
Comment on attachment 426124 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426124&action=review

> Source/WebKit/ChangeLog:9
> +        Introduce WK_API_UNAVAILABLE to make that API are not available in certain OSes.

s/make that API are not available/make that API not available/
Comment 13 EWS 2021-04-15 13:04:52 PDT
Tools/Scripts/svn-apply failed to apply attachment 426124 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 14 Alex Christensen 2021-04-15 15:42:34 PDT
Created attachment 426144 [details]
Patch
Comment 15 EWS 2021-04-16 01:47:31 PDT
Committed r276125 (236621@main): <https://commits.webkit.org/236621@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426144 [details].