<?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>32879</bug_id>
          
          <creation_ts>2009-12-22 13:08:21 -0800</creation_ts>
          <short_desc>[GTK] Only load dictionaries if spell check is enabled</short_desc>
          <delta_ts>2011-06-02 10:16:36 -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>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christian Dywan">christian</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>joone.hur</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>174349</commentid>
    <comment_count>0</comment_count>
    <who name="Christian Dywan">christian</who>
    <bug_when>2009-12-22 13:08:21 -0800</bug_when>
    <thetext>Currently enchant dictionaries are loaded unconditionally for any new WebKitWebSettings, regardless of whether enable-spell-checking is enabled or not. This has two side effects: enchant is initialized even when not used. And the languages are loaded twice if the application changes spell-checking-languages before enabling spell checking.

I suggest the languages should only be initialized if spell checking is enabled. The dictionary loading should therefore be moved into a helper function and called as needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>413908</commentid>
    <comment_count>1</comment_count>
    <who name="Joone Hur">joone.hur</who>
    <bug_when>2011-06-01 22:12:46 -0700</bug_when>
    <thetext>These is a case which WebKitGtk+ can&apos;t load dictionaries as follows:
(gdb) bt
#0  0x0012e416 in __kernel_vsyscall ()
#1  0x0409ee71 in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0x040a234e in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0x040d5577 in ?? () from /lib/i386-linux-gnu/libc.so.6
#4  0x04159df0 in __fortify_fail () from /lib/i386-linux-gnu/libc.so.6
#5  0x04158cca in __chk_fail () from /lib/i386-linux-gnu/libc.so.6
#6  0x0415805f in __strcpy_chk () from /lib/i386-linux-gnu/libc.so.6
#7  0x0437b412 in strcpy (this=0x80f0520, word=0x80f7090 &quot;0&quot;, wbl=1, wcl=1, aff=0x80efd38, al=2, desc=0x0, onlyupcase=false) at /usr/include/bits/string3.h:105
#8  HashMgr::add_word (this=0x80f0520, word=0x80f7090 &quot;0&quot;, wbl=1, wcl=1, aff=0x80efd38, al=2, desc=0x0, onlyupcase=false) at hashmgr.cxx:138
#9  0x0437bc6d in HashMgr::load_tables (this=0x80f0520, tpath=0x80eff38 &quot;/home/joone/checkout/gnome/build/share/myspell/dicts/en_US.dic&quot;, key=0x0) at hashmgr.cxx:470
#10 0x0437becb in HashMgr::HashMgr (this=0x80f0520, tpath=0x80eff38 &quot;/home/joone/checkout/gnome/build/share/myspell/dicts/en_US.dic&quot;, apath=0x80f0050 &quot;/home/joone/checkout/gnome/build/share/myspell/dicts/en_US.aff&quot;, key=0x0)
    at hashmgr.cxx:52
#11 0x0437c233 in Hunspell::Hunspell (this=0x80f0160, affpath=0x80f0050 &quot;/home/joone/checkout/gnome/build/share/myspell/dicts/en_US.aff&quot;, dpath=0x80eff38 &quot;/home/joone/checkout/gnome/build/share/myspell/dicts/en_US.dic&quot;, key=0x0)
    at hunspell.cxx:34
#12 0x0438c2a9 in MySpellChecker::requestDictionary (this=0x80ec9e0, szLang=0x80f0328 &quot;en_US&quot;) at myspell_checker.cpp:423
#13 0x0438c42f in myspell_provider_request_dict (me=0x80ecf78, tag=0x80f0328 &quot;en_US&quot;) at myspell_checker.cpp:549
#14 0x02e5c745 in _enchant_broker_request_dict (broker=0x80ec4f0, tag=0x80f0328 &quot;en_US&quot;) at enchant.c:1807
#15 0x02e5daf1 in enchant_broker_request_dict (broker=0x80ec4f0, tag=0x80c9fb4 &quot;en-us&quot;) at enchant.c:1853
#16 0x009ebf43 in WebKit::TextCheckerClientEnchant::updateSpellCheckingLanguage (this=0x80b8198, spellCheckingLanguages=0x0) at ../../Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.cpp:187
#17 0x00a414a3 in webkit_web_view_update_settings (webView=0x80b9020) at ../../Source/WebKit/gtk/webkit/webkitwebview.cpp:3292
#18 0x00a4257a in webkit_web_view_init (webView=0x80b9020) at ../../Source/WebKit/gtk/webkit/webkitwebview.cpp:3478
#19 0x038eb5a9 in g_type_create_instance (type=134919616) at gtype.c:1885
#20 0x038c7f65 in g_object_constructor (type=134919616, n_construct_properties=2, construct_params=0x80b6b58) at gobject.c:1615
#21 0x038caf64 in g_object_newv (object_type=134919616, n_parameters=0, parameters=0x0) at gobject.c:1479
#22 0x038cc330 in g_object_new (object_type=134919616, first_property_name=0x0) at gobject.c:1308
#23 0x00a42703 in webkit_web_view_new () at ../../Source/WebKit/gtk/webkit/webkitwebview.cpp:3491
#24 0x0804a1ce in createWindow (outWebView=0xbfffead0) at ../../Tools/GtkLauncher/main.c:202
#25 0x0804a3fe in main (argc=1, argv=0xbfffeba4) at ../../Tools/GtkLauncher/main.c:253</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>413953</commentid>
    <comment_count>2</comment_count>
      <attachid>95730</attachid>
    <who name="Joone Hur">joone.hur</who>
    <bug_when>2011-06-02 00:02:35 -0700</bug_when>
    <thetext>Created attachment 95730
Proposed Patch

This patch allows WebKitGtk+ to skip loading dictionaries when spell-checking is not enabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>414130</commentid>
    <comment_count>3</comment_count>
      <attachid>95730</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2011-06-02 08:10:52 -0700</bug_when>
    <thetext>Comment on attachment 95730
Proposed Patch

Nice!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>414235</commentid>
    <comment_count>4</comment_count>
      <attachid>95730</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-06-02 10:16:31 -0700</bug_when>
    <thetext>Comment on attachment 95730
Proposed Patch

Clearing flags on attachment: 95730

Committed r87925: &lt;http://trac.webkit.org/changeset/87925&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>414236</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-06-02 10:16:36 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>95730</attachid>
            <date>2011-06-02 00:02:35 -0700</date>
            <delta_ts>2011-06-02 10:16:31 -0700</delta_ts>
            <desc>Proposed Patch</desc>
            <filename>enchant.patch</filename>
            <type>text/plain</type>
            <size>3629</size>
            <attacher name="Joone Hur">joone.hur</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvZ3RrL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQv
Z3RrL0NoYW5nZUxvZwppbmRleCA0YzQ2MGE4Li5lYmZlYWQ2IDEwMDY0NAotLS0gYS9Tb3VyY2Uv
V2ViS2l0L2d0ay9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdC9ndGsvQ2hhbmdlTG9nCkBA
IC0xLDMgKzEsMTYgQEAKKzIwMTEtMDYtMDIgIEpvb25lIEh1ciAgPGpvb25lLmh1ckBjb2xsYWJv
cmEuY28udWs+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTIS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GVja2VyQ2xpZW50RW5jaGFudCo+KGNsaWVudC0+dGV4dENo
ZWNrZXIoKSktPnVwZGF0ZVNwZWxsQ2hlY2tpbmdMYW5ndWFnZShnX3ZhbHVlX2dldF9zdHJpbmco
JnZhbHVlKSk7CisgICAgICAgIH0KICAgICB9CiAjZW5kaWYKIAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>