Bug 218558 - WKContentView might get KVO notifications it doesn't expect
Summary: WKContentView might get KVO notifications it doesn't expect
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-04 03:46 PST by Dean Jackson
Modified: 2020-11-04 10:44 PST (History)
3 users (show)

See Also:


Attachments
Patch (3.00 KB, patch)
2020-11-04 03:55 PST, Dean Jackson
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2020-11-04 03:46:12 PST
WKContextView might get KVO notifications it doesn't expect
Comment 1 Radar WebKit Bug Importer 2020-11-04 03:47:00 PST
<rdar://problem/71031491>
Comment 2 Dean Jackson 2020-11-04 03:55:44 PST
Created attachment 413154 [details]
Patch
Comment 3 Tim Horton 2020-11-04 04:01:55 PST
Comment on attachment 413154 [details]
Patch

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

> Source/WebKit/ChangeLog:3
> +        WKContextView might get KVO notifications it doesn't expect

I think the title means WKContentView

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:739
> -    [self.layer addObserver:self forKeyPath:@"transform" options:NSKeyValueObservingOptionInitial context:nil];
> +    [self.layer addObserver:self forKeyPath:@"transform" options:NSKeyValueObservingOptionInitial context:WKContentViewKVOTransformContext];

Should we use the context in the deregistration too? I feel like there is some documented benefit.
Comment 4 Dean Jackson 2020-11-04 09:42:39 PST
Comment on attachment 413154 [details]
Patch

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

>> Source/WebKit/ChangeLog:3
>> +        WKContextView might get KVO notifications it doesn't expect
> 
> I think the title means WKContentView

Yep! Thanks.

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:739
>> +    [self.layer addObserver:self forKeyPath:@"transform" options:NSKeyValueObservingOptionInitial context:WKContentViewKVOTransformContext];
> 
> Should we use the context in the deregistration too? I feel like there is some documented benefit.

OK!
Comment 5 Dean Jackson 2020-11-04 10:44:56 PST
Committed r269372: <https://trac.webkit.org/changeset/269372>