<?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>101215</bug_id>
          
          <creation_ts>2012-11-05 06:52:39 -0800</creation_ts>
          <short_desc>[WK2][EFL][GTK] early return of checkSpellingOfString treats correct words as misspelled</short_desc>
          <delta_ts>2012-11-06 07:15:22 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore 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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>93611</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Grzegorz Czajkowski">g.czajkowski</reporter>
          <assigned_to name="Grzegorz Czajkowski">g.czajkowski</assigned_to>
          <cc>andersca</cc>
    
    <cc>cgarcia</cc>
    
    <cc>jberlin</cc>
    
    <cc>mario</cc>
    
    <cc>morrita</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>758492</commentid>
    <comment_count>0</comment_count>
    <who name="Grzegorz Czajkowski">g.czajkowski</who>
    <bug_when>2012-11-05 06:52:39 -0800</bug_when>
    <thetext>Patch from bug 93611 which enables the spelling setting for WebKitTestRunner causes regressions for WebKit2-EFL debug build.
It&apos;s related to WK2 only as it (exactly WebProcess) passes references of misspellingLocation and misspellingLength to the UIProcess and it expects (I assume) that those values have to be updated in the UIProcess. In the other case those values store garbage :)
You can see this that code in WebEditorClient.cpp:

void WebEditorClient::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength)
{
    int32_t resultLocation = -1;
    int32_t resultLength = 0;
    // FIXME: It would be nice if we wouldn&apos;t have to copy the text here.
    m_page-&gt;sendSync(Messages::WebPageProxy::CheckSpellingOfString(String(text, length)),
        Messages::WebPageProxy::CheckSpellingOfString::Reply(resultLocation, resultLength));
    *misspellingLocation = resultLocation;
    *misspellingLength = resultLength;
}

First receiver (WebPageProxy::checkSpellingOfString) doesn&apos;t receive -1 and 0 as it was assumed but the random values. If nobody updates them those unexpected values will be used in WebCore and they cause assertions.

There are (at least) two ways of solving this issue:
1) Fix CoreIPC mechanism (not sure if it&apos;s possible) to have a possibility to receive the default values (-1, 0) by UIProcess.
2) Fix TextCheckerEnchant::checkSpellingOfString by saving at the beginning of the method the default values (-1, 0) to its output parameters.

Any opinions?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759463</commentid>
    <comment_count>1</comment_count>
      <attachid>172534</attachid>
    <who name="Grzegorz Czajkowski">g.czajkowski</who>
    <bug_when>2012-11-06 02:48:31 -0800</bug_when>
    <thetext>Created attachment 172534
fix checkSpellingOfString in TextCheckerEnchant class</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759540</commentid>
    <comment_count>2</comment_count>
      <attachid>172534</attachid>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2012-11-06 04:52:40 -0800</bug_when>
    <thetext>Comment on attachment 172534
fix checkSpellingOfString in TextCheckerEnchant class

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

As I said on IRC, this makes sense to me, I&apos;d recommend removing the assingment from the original WebProcess call site to make it clearer that those values do not get here.

&gt; Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp:71
&gt; +    // Assume that the words in the @a string are spelled correctly.

This @a in the comment looks like a formatting annotation which doesn&apos;t make sense in private/cross-platform comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759564</commentid>
    <comment_count>3</comment_count>
      <attachid>172559</attachid>
    <who name="Grzegorz Czajkowski">g.czajkowski</who>
    <bug_when>2012-11-06 05:38:08 -0800</bug_when>
    <thetext>Created attachment 172559
apply Gustavo&apos;s suggestions - patch for landing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759567</commentid>
    <comment_count>4</comment_count>
    <who name="Grzegorz Czajkowski">g.czajkowski</who>
    <bug_when>2012-11-06 05:44:15 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 172534 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=172534&amp;action=review
&gt; 
&gt; As I said on IRC, this makes sense to me, I&apos;d recommend removing the assingment from the original WebProcess call site to make it clearer that those values do not get here.

Thanks for review. In my opinions those initializations are needed to do not make compilation warnings. I completely agree that they are never seen in UIProcess.

As we discussed on IRC it&apos;d be good to initialize them in WebPageProxy to fix that potential issue for other ports too.  

&gt; 
&gt; &gt; Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp:71
&gt; &gt; +    // Assume that the words in the @a string are spelled correctly.
&gt; 
&gt; This @a in the comment looks like a formatting annotation which doesn&apos;t make sense in private/cross-platform comments.

Right. Removed &apos;@a&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759645</commentid>
    <comment_count>5</comment_count>
      <attachid>172559</attachid>
    <who name="Grzegorz Czajkowski">g.czajkowski</who>
    <bug_when>2012-11-06 07:15:17 -0800</bug_when>
    <thetext>Comment on attachment 172559
apply Gustavo&apos;s suggestions - patch for landing

Clearing flags on attachment: 172559

Committed r133602: &lt;http://trac.webkit.org/changeset/133602&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759646</commentid>
    <comment_count>6</comment_count>
    <who name="Grzegorz Czajkowski">g.czajkowski</who>
    <bug_when>2012-11-06 07:15:22 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>172534</attachid>
            <date>2012-11-06 02:48:31 -0800</date>
            <delta_ts>2012-11-06 05:38:08 -0800</delta_ts>
            <desc>fix checkSpellingOfString in TextCheckerEnchant class</desc>
            <filename>spelling-checkSpellingOfString_Fix.patch</filename>
            <type>text/plain</type>
            <size>1712</size>
            <attacher name="Grzegorz Czajkowski">g.czajkowski</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAyYjYwNjIxLi43NTU3ZWQ5IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTgg
QEAKKzIwMTItMTEtMDYgIEdyemVnb3J6IEN6YWprb3dza2kgIDxnLmN6YWprb3dza2lAc2Ftc3Vu
Zy5jb20+CisKKyAgICAgICAgW1dLMl1bRUZMXVtHVEtdIGVhcmx5IHJldHVybiBvZiBjaGVja1Nw
ZWxsaW5nT2ZTdHJpbmcgdHJlYXRzIGNvcnJlY3Qgd29yZHMgYXMgbWlzc3BlbGxlZAorICAgICAg
ICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTAxMjE1CisKKyAgICAg
ICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgU2F2ZSB0aGUgbWlzc3Bl
bGxlZCBsb2NhdGlvbiBhbmQgbGVuZ3RoIG9mIHRoZSBzdHJpbmcgdG8gdGhlIGRlZmF1bHQgdmFs
dWVzICgtMSwgMCkKKyAgICAgICAgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUgY2hlY2tTcGVsbGlu
Z09mU3RyaW5nIG1ldGhvZC4KKyAgICAgICAgSXQgYXNzdW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gd29yZCkKIAogdm9pZCBUZXh0Q2hlY2tlckVuY2hhbnQ6OmNo
ZWNrU3BlbGxpbmdPZlN0cmluZyhjb25zdCBTdHJpbmcmIHN0cmluZywgaW50JiBtaXNzcGVsbGlu
Z0xvY2F0aW9uLCBpbnQmIG1pc3NwZWxsaW5nTGVuZ3RoKQogeworICAgIC8vIEFzc3VtZSB0aGF0
IHRoZSB3b3JkcyBpbiB0aGUgQGEgc3RyaW5nIGFyZSBzcGVsbGVkIGNvcnJlY3RseS4KKyAgICBt
aXNzcGVsbGluZ0xvY2F0aW9uID0gLTE7CisgICAgbWlzc3BlbGxpbmdMZW5ndGggPSAwOworCiAg
ICAgaWYgKG1fZW5jaGFudERpY3Rpb25hcmllcy5pc0VtcHR5KCkpCiAgICAgICAgIHJldHVybjsK
IAo=
</data>
<flag name="review"
          id="186882"
          type_id="1"
          status="+"
          setter="gustavo"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>172559</attachid>
            <date>2012-11-06 05:38:08 -0800</date>
            <delta_ts>2012-11-06 07:15:17 -0800</delta_ts>
            <desc>apply Gustavo&apos;s suggestions - patch for landing</desc>
            <filename>spelling-checkSpellingOfString_Fix.patch</filename>
            <type>text/plain</type>
            <size>1722</size>
            <attacher name="Grzegorz Czajkowski">g.czajkowski</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAyMDc1MDM4Li42YmE5MTEwIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTgg
QEAKKzIwMTItMTEtMDYgIEdyemVnb3J6IEN6YWprb3dza2kgIDxnLmN6YWprb3dza2lAc2Ftc3Vu
Zy5jb20+CisKKyAgIC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