Bug 86118

Summary: [gtk] Spell checker doesn't recognize contractions (apostrophes)
Product: WebKit Reporter: Eric Gregory <eric>
Component: WebKitGTKAssignee: Martin Robinson <mrobinson>
Status: RESOLVED FIXED    
Severity: Normal CC: adam, darin, jim, mrobinson, pnormand, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 86936, 88016    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Eric Gregory 2012-05-10 11:19:10 PDT
Our application uses an editable WebKitGTK instance with the spell checking feature enabled.  Unfortunately, the spell checker doesn't recognize contractions properly.

For example, if you type "I've" you will get the "ve" marked as misspelled.

This bug doesn't seem to appear in Safari or Apple Mail, so I'd assume this is related specifically to WebKitGTK.
Comment 1 Martin Robinson 2012-05-11 20:22:10 PDT
Created attachment 141548 [details]
Patch
Comment 2 WebKit Review Bot 2012-05-18 14:30:08 PDT
Comment on attachment 141548 [details]
Patch

Clearing flags on attachment: 141548

Committed r117628: <http://trac.webkit.org/changeset/117628>
Comment 3 WebKit Review Bot 2012-05-18 14:30:12 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 WebKit Review Bot 2012-05-18 21:18:23 PDT
Re-opened since this is blocked by 86936
Comment 5 Philippe Normand 2012-05-18 21:21:30 PDT
Sorry I had to roll this one out, it caused timeouts in the editing test suite.
Comment 6 Martin Robinson 2012-05-18 23:32:41 PDT
(In reply to comment #5)
> Sorry I had to roll this one out, it caused timeouts in the editing test suite.

Thanks for rolling this out. I'll post a revised patch soon.
Comment 7 Martin Robinson 2012-05-21 19:27:21 PDT
Created attachment 143171 [details]
Patch
Comment 8 Martin Robinson 2012-05-21 19:30:58 PDT
I've uploaded a new version of the patch that (I hope) fixes the failures. It seems that the documentation for g_utf8_find_next_char wasn't clear about what return values indicate terminating situations. It's necessary to check both word == 0 and *word == 0.

I have also improved the code in SpellCheckerEnchant to deal with more than one word at a time. I realized that WebKit will sometimes send more than one word after further testing.

This passes tests locally for me.
Comment 9 WebKit Review Bot 2012-05-31 09:36:46 PDT
Comment on attachment 143171 [details]
Patch

Clearing flags on attachment: 143171

Committed r119113: <http://trac.webkit.org/changeset/119113>
Comment 10 WebKit Review Bot 2012-05-31 09:36:50 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 WebKit Review Bot 2012-05-31 15:09:55 PDT
Re-opened since this is blocked by 88016
Comment 12 Martin Robinson 2012-06-27 09:31:14 PDT
I believe that I was wrong to attempt to try to move away from Pango for word splitting here. Word splitting depends a great deal on language and Pango encapsulates all those smarts. It turns out that this bug is actually https://bugzilla.gnome.org/show_bug.cgi?id=97545.

It seems reasonable that we can just duplicate the work-around that gtkspell uses, which is to special case apostrophes followed by alphabetic characters.
Comment 13 Martin Robinson 2012-06-27 10:06:02 PDT
Created attachment 149770 [details]
Patch
Comment 14 Gustavo Noronha (kov) 2012-06-27 12:20:07 PDT
Comment on attachment 149770 [details]
Patch

Third time is the charm?
Comment 15 WebKit Review Bot 2012-06-27 13:22:49 PDT
Comment on attachment 149770 [details]
Patch

Clearing flags on attachment: 149770

Committed r121360: <http://trac.webkit.org/changeset/121360>
Comment 16 WebKit Review Bot 2012-06-27 13:22:56 PDT
All reviewed patches have been landed.  Closing bug.