<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>122329</bug_id>
          
          <creation_ts>2013-10-04 10:08:47 -0700</creation_ts>
          <short_desc>[Mac] Don&apos;t preflight spell checker when calling -setContinuousSpellCheckingEnabled repeatedly</short_desc>
          <delta_ts>2013-10-04 23:39:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Proskuryakov">ap</reporter>
          <assigned_to name="Alexey Proskuryakov">ap</assigned_to>
          <cc>darin</cc>
    
    <cc>enrica</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>936224</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-10-04 10:08:47 -0700</bug_when>
    <thetext>In &lt;rdar://problem/15145394&gt;, 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&apos;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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936225</commentid>
    <comment_count>1</comment_count>
      <attachid>213369</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-10-04 10:11:41 -0700</bug_when>
    <thetext>Created attachment 213369
proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936430</commentid>
    <comment_count>2</comment_count>
      <attachid>213369</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-10-04 17:00:18 -0700</bug_when>
    <thetext>Comment on attachment 213369
proposed patch

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

&gt; Source/WebKit/mac/WebView/WebView.mm:-5547
&gt;      if (continuousSpellCheckingEnabled != flag) {
&gt;          continuousSpellCheckingEnabled = flag;
&gt;          [[NSUserDefaults standardUserDefaults] setBool:continuousSpellCheckingEnabled forKey:WebContinuousSpellCheckingEnabled];
&gt; -    }

I think this would read better as early return than with all the code nested inside and if statement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>936528</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-10-04 23:39:43 -0700</bug_when>
    <thetext>&gt; I think this would read better as early return than with all the code nested inside and if statement.

Oops. Fixed and landed in &lt;http://trac.webkit.org/r156949&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>213369</attachid>
            <date>2013-10-04 10:11:41 -0700</date>
            <delta_ts>2013-10-04 17:00:17 -0700</delta_ts>
            <desc>proposed patch</desc>
            <filename>SpellChecker.txt</filename>
            <type>text/plain</type>
            <size>1653</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJLaXQvbWFjL0NoYW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T09PT09PT09PT09PT09PQotLS0gU291cmNlL1dlYktpdC9tYWMvV2ViVmlldy9XZWJWaWV3
Lm1tCShyZXZpc2lvbiAxNTY4MzYpCisrKyBTb3VyY2UvV2ViS2l0L21hYy9XZWJWaWV3L1dlYlZp
ZXcubW0JKHdvcmtpbmcgY29weSkKQEAgLTU1NDQsMTIgKzU1NDQsMTEgQEAgLSAodm9pZClzZXRD
b250aW51b3VzU3BlbGxDaGVja2luZ0VuYWJsZQogICAgIGlmIChjb250aW51b3VzU3BlbGxDaGVj
a2luZ0VuYWJsZWQgIT0gZmxhZykgewogICAgICAgICBjb250aW51b3VzU3BlbGxDaGVja2luZ0Vu
YWJsZWQgPSBmbGFnOwogICAgICAgICBbW05TVXNlckRlZmF1bHRzIHN0YW5kYXJkVXNlckRlZmF1
bHRzXSBzZXRCb29sOmNvbnRpbnVvdXNTcGVsbENoZWNraW5nRW5hYmxlZCBmb3JLZXk6V2ViQ29u
dGludW91c1NwZWxsQ2hlY2tpbmdFbmFibGVkXTsKLSAgICB9Ci0gICAgCi0gICAgaWYgKFtzZWxm
IGlzQ29udGludW91c1NwZWxsQ2hlY2tpbmdFbmFibGVkXSkgewotICAgICAgICBbW3NlbGYgY2xh
c3NdIF9wcmVmbGlnaHRTcGVsbENoZWNrZXJdOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIFtbc2Vs
ZiBtYWluRnJhbWVdIF91bm1hcmtBbGxNaXNzcGVsbGluZ3NdOworCisgICAgICAgIGlmIChbc2Vs
ZiBpc0NvbnRpbnVvdXNTcGVsbENoZWNraW5nRW5hYmxlZF0pCisgICAgICAgICAgICBbW3NlbGYg
Y2xhc3NdIF9wcmVmbGlnaHRTcGVsbENoZWNrZXJdOworICAgICAgICBlbHNlCisgICAgICAgICAg
ICBbW3NlbGYgbWFpbkZyYW1lXSBfdW5tYXJrQWxsTWlzc3BlbGxpbmdzXTsKICAgICB9CiB9CiAK
</data>
<flag name="review"
          id="235717"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>