Bug 233954

Summary: Make KVO work for WKWebpagePreferences._captivePortalModeEnabled
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, ggaren, kkinnunen, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=233900
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Chris Dumez 2021-12-07 14:22:55 PST
Make KVO work for WKWebpagePreferences._captivePortalModeEnabled so that the client can observe when the system setting changes.
Comment 1 Chris Dumez 2021-12-07 14:29:11 PST
Created attachment 446237 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-12-07 16:31:47 PST
<rdar://problem/86182490>
Comment 3 Chris Dumez 2021-12-07 16:37:42 PST
Created attachment 446253 [details]
Patch
Comment 4 Alex Christensen 2021-12-08 09:09:02 PST
Comment on attachment 446253 [details]
Patch

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

> Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:125
> +#if USE(APPLE_INTERNAL_SDK)

Why?
Also, I don't see an implementation of this.

> Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:138
> +    id m_object;

WeakObjCPtr<id>
Comment 5 Chris Dumez 2021-12-08 09:10:54 PST
(In reply to Alex Christensen from comment #4)
> Comment on attachment 446253 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=446253&action=review
> 
> > Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:125
> > +#if USE(APPLE_INTERNAL_SDK)
> 
> Why?
> Also, I don't see an implementation of this.

Please see corresponding patch in Internal.

> 
> > Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:138
> > +    id m_object;
> 
> WeakObjCPtr<id>

Ok.
Comment 6 Wenson Hsieh 2021-12-08 09:14:09 PST
Comment on attachment 446253 [details]
Patch

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

>>> Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm:125
>>> +#if USE(APPLE_INTERNAL_SDK)
>> 
>> Why?
>> Also, I don't see an implementation of this.
> 
> Please see corresponding patch in Internal.

FWIW, `USE(APPLE_INTERNAL_SDK)` is typically only used to guard WKA header includes. You could do something here like:

```
#if USE(APPLE_INTERNAL_SDK)
// include the WKA header
#else
// define empty method stubs
#endif
```

…and then avoid having to use `USE(APPLE_INTERNAL_SDK)` here.
Comment 7 Chris Dumez 2021-12-08 09:46:25 PST
Created attachment 446379 [details]
Patch
Comment 8 Chris Dumez 2021-12-08 10:05:05 PST
Comment on attachment 446379 [details]
Patch

Clearing flags on attachment: 446379

Committed r286661 (?): <https://commits.webkit.org/r286661>
Comment 9 Chris Dumez 2021-12-08 10:05:08 PST
All reviewed patches have been landed.  Closing bug.