Bug 122329

Summary: [Mac] Don't preflight spell checker when calling -setContinuousSpellCheckingEnabled repeatedly
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebKit Misc.Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, enrica, rniwa
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch darin: review+

Alexey Proskuryakov
Reported 2013-10-04 10:08:47 PDT
In <rdar://problem/15145394>, I observed a case where WebKit1 tests would fail to function because of repeated attempts to launch spellchecking service. DumpRenderTree calls -[WebView setContinuousSpellCheckingEnabled:YES] before each test, and this results in WebKit calling [[NSSpellChecker sharedSpellChecker] _preflightChosenSpellServer], which in turn launches the service if it's not launched yet. What I observed was that launchservicesd was busy servicing AppleSpell.service registrations, and this was making service launch time out, and this was making us try to re-launch it again and again. I'm not sure what the initial trigger for the misbehavior was, but repeatedly trying to relaunch an app that fails to launch makes little sense.
Attachments
proposed patch (1.61 KB, patch)
2013-10-04 10:11 PDT, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2013-10-04 10:11:41 PDT
Created attachment 213369 [details] proposed patch
Darin Adler
Comment 2 2013-10-04 17:00:18 PDT
Comment on attachment 213369 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=213369&action=review > Source/WebKit/mac/WebView/WebView.mm:-5547 > if (continuousSpellCheckingEnabled != flag) { > continuousSpellCheckingEnabled = flag; > [[NSUserDefaults standardUserDefaults] setBool:continuousSpellCheckingEnabled forKey:WebContinuousSpellCheckingEnabled]; > - } I think this would read better as early return than with all the code nested inside and if statement.
Alexey Proskuryakov
Comment 3 2013-10-04 23:39:43 PDT
> I think this would read better as early return than with all the code nested inside and if statement. Oops. Fixed and landed in <http://trac.webkit.org/r156949>.
Note You need to log in before you can comment on or make changes to this bug.