Don't waste time under -setupInteraction under -initWithFrame for unparented WKWebViews
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Oct 2018 21:22:36 +0000 (21:22 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Oct 2018 21:22:36 +0000 (21:22 +0000)
commit7de17542fd8bac526da2d957485de119e6f34e56
tree50fa0e2c5ea1872e8f6710c7fcb6a8112c55fe60
parent677729bd6ec159ab16bc1264e8e61d4dff5f61d5
Don't waste time under -setupInteraction under -initWithFrame for unparented WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=190801
<rdar://problem/43674361>

Reviewed by Megan Gardner.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView didMoveToWindow]):
Defer the first call to WKContentViewInteraction's -setupInteraction
until the view is parented. This avoids a few milliseconds of unnecessary
work for views that are never parented.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
Keep track of the current state of WKContentViewInteraction's gestures.
Use this to make it OK to call -setupInteraction multiple times.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentView.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm