RESOLVED FIXED 143115
REGRESSION(r180768): Slower startup time for WKWebView
https://bugs.webkit.org/show_bug.cgi?id=143115
Summary REGRESSION(r180768): Slower startup time for WKWebView
Enrica Casucci
Reported 2015-03-26 15:16:30 PDT
In http://trac.webkit.org/changeset/180768 we added an observer to track visibility of the NSFontPanel to ensure we could fetch the font information for the current selection when the panel first became visible. It turns out that adding the observer requires the shared font panel object to be created. That is apparently a very expensive operation that is regressing the initialization time for the WKWebView. We should do that lazily. rdar://problem/20233711
Attachments
Patch (4.97 KB, patch)
2015-03-26 15:24 PDT, Enrica Casucci
no flags
Patch2 (6.88 KB, patch)
2015-03-26 15:52 PDT, Enrica Casucci
andersca: review+
Enrica Casucci
Comment 1 2015-03-26 15:24:47 PDT
Anders Carlsson
Comment 2 2015-03-26 15:28:07 PDT
Comment on attachment 249518 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=249518&action=review > Source/WebKit2/UIProcess/API/mac/WKView.mm:2622 > + [[NSFontPanel sharedFontPanel] addObserver:self forKeyPath:@"visible" options:NSKeyValueObservingOptionNew context:nil]; I don't think you need NSKeyValueObservingOptionNew unless you actually get it from the dictionary in your observe method. Also you need to specify a context. Just add something like static void* wkViewObservationContext = &wkViewObservationContext; and pass that in add and remove. You also need to compare the context in your observe method.
Enrica Casucci
Comment 3 2015-03-26 15:52:56 PDT
Created attachment 249524 [details] Patch2 New patch that includes feedback from Anders.
Enrica Casucci
Comment 4 2015-03-26 15:54:08 PDT
Comment on attachment 249524 [details] Patch2 View in context: https://bugs.webkit.org/attachment.cgi?id=249524&action=review > Source/WebKit2/UIProcess/API/mac/WKView.mm:3728 > + NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingCursorUpdate; Please disregard this line. I had to update ToT.
Enrica Casucci
Comment 5 2015-03-26 16:25:04 PDT
Committed revision 182037.
Note You need to log in before you can comment on or make changes to this bug.