Bug 181125 - WKWebView's didMoveToWindow doesn't call it's super
Summary: WKWebView's didMoveToWindow doesn't call it's super
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Safari 11
Hardware: iPhone / iPad All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-22 04:18 PST by Gabriel Banfalvi
Modified: 2017-12-22 12:44 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Banfalvi 2017-12-22 04:18:23 PST
WKWebView doesn't call UIView's (it's super-class') didMoveToWindow despite overriding it. 

It looks like this in UIProcess/API/Cocoa/WKWebView.mm

- (void)didMoveToWindow
{
    _page->activityStateDidChange(WebCore::ActivityState::AllFlags);
}

While in principle didMoveToWindow tends to be empty, I'm swizzling out will/didMoveToWindow on UIView to track hierarchy changes in UIViews (haven't found a better way to do that), and this breaks that.
Comment 1 Radar WebKit Bug Importer 2017-12-22 12:44:02 PST
<rdar://problem/36197325>