Bug 234013

Summary: Add a new WKWebpagePreferences SPI for modal container observation policies
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebKit APIAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, bfulgham, cdumez, ews-watchlist, japhet, katherine_cheney, thorton, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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].