Bug 234013 - Add a new WKWebpagePreferences SPI for modal container observation policies
Summary: Add a new WKWebpagePreferences SPI for modal container observation policies
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-08 09:56 PST by Wenson Hsieh
Modified: 2021-12-09 21:06 PST (History)
9 users (show)

See Also:


Attachments
Patch (13.82 KB, patch)
2021-12-08 11:09 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (14.62 KB, patch)
2021-12-09 18:08 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2021-12-08 09:56:19 PST
.
Comment 1 Radar WebKit Bug Importer 2021-12-08 10:52:00 PST
<rdar://problem/86219613>
Comment 2 Wenson Hsieh 2021-12-08 11:09:28 PST
Created attachment 446390 [details]
Patch
Comment 3 Brent Fulgham 2021-12-09 15:54:00 PST
Comment on attachment 446390 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:466
> +        _websitePolicies->setModalContainerObservationPolicy(WebCore::ModalContainerObservationPolicy::Disabled);

It really seems silly to require these adaptor methods for these equivalent enums, but I realize that's just the way this stuff is designed.
Comment 4 Wenson Hsieh 2021-12-09 16:15:00 PST
Comment on attachment 446390 [details]
Patch

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

Thanks for the review!

>> Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:466
>> +        _websitePolicies->setModalContainerObservationPolicy(WebCore::ModalContainerObservationPolicy::Disabled);
> 
> It really seems silly to require these adaptor methods for these equivalent enums, but I realize that's just the way this stuff is designed.

Indeed. That said, it does seem like it would be cleaner to separate the adapter method away from the call to `setModalContainerObservationPolicy` by adding a helper method like `WebKit::coreModalContainerObservationPolicy()`, similar to the mouse event policy one above. I'll do this before landing!
Comment 5 Wenson Hsieh 2021-12-09 18:08:07 PST
Created attachment 446646 [details]
Patch
Comment 6 EWS 2021-12-09 21:06:38 PST
Committed r286831 (245064@main): <https://commits.webkit.org/245064@main>

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