Bug 189222 - [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class is not key value coding-compliant for the key serverTrust"
Summary: [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: mitz
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-01 15:55 PDT by mitz
Modified: 2019-12-06 14:08 PST (History)
2 users (show)

See Also:


Attachments
Override -valueForUndefinedKey: to handle "serverTrust" (8.08 KB, patch)
2018-09-01 16:02 PDT, mitz
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2018-09-01 15:55:35 PDT
<rdar://problem/33283179>

WKWebView.h says that the class is key-value observing (KVO) compliant for the serverTrust property, and the implementation correctly reports changes to the property’s value, but it fails to make the property key value coding-complaint, so trying to get it using -valueForKey: either directly or as a side-effect of using specifying NSKeyValueObservingOptionNew or NSKeyValueObservingOptionOld results in an exception.

Patch forthcoming.
Comment 1 mitz 2018-09-01 16:02:32 PDT
Created attachment 348719 [details]
Override -valueForUndefinedKey: to handle "serverTrust"
Comment 2 mitz 2018-09-01 16:14:43 PDT
Fixed in <https://trac.webkit.org/r235584>.
Comment 3 Simon Fraser (smfr) 2019-12-06 13:48:43 PST
Comment on attachment 348719 [details]
Override -valueForUndefinedKey: to handle "serverTrust"

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

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:823
> +- (id)valueForUndefinedKey:(NSString *)key {

{ on new line please.
Comment 4 mitz 2019-12-06 14:08:09 PST
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 348719 [details]
> Override -valueForUndefinedKey: to handle "serverTrust"
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=348719&action=review
> 
> > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:823
> > +- (id)valueForUndefinedKey:(NSString *)key {
> 
> { on new line please.

Fixed in r253216.