Bug 12812

Summary: REGRESSION: In Gmail Check Spelling As you Type underline doesn't cover certain words
Product: WebKit Reporter: Stephen Harbage <s_harbage>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: koivisto, mitz, vladimir.olexa
Priority: P2 Keywords: InRadar
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://mail.google.com/mail/
Attachments:
Description Flags
Ruth example 1
none
Ruth example 2
none
Text areas showing different text sizes none

Description Stephen Harbage 2007-02-19 09:38:19 PST
Summery:
If you have Check Spelling as You Type on in Gmail certain wrongly spelt words don't have the red underline covering them properly.

Steps to reproduce:
1. Go to Gmail>compose
2. Ctrl/right-click and ensure Spelling>Check Spelling as you type is ticked
3. type in the Google search at the top, To: Subject: or the bit where you type in the actual message:
ruth
hellloi
needgod

This works fine in 419.3 but in the nightly the red underline doesn't cover the words properly.

Works fine in other sites with text boxes e.g.
http://www.apple.com/macosx/feedback/

Some words work fine but others don't for some reason
Comment 1 Stephen Harbage 2007-02-19 09:39:40 PST
Created attachment 13240 [details]
Ruth example 1
Comment 2 Stephen Harbage 2007-02-19 09:40:37 PST
Created attachment 13241 [details]
Ruth example 2
Comment 3 Vladimir Olexa (vladinecko) 2007-02-20 21:23:39 PST
Created attachment 13286 [details]
Text areas showing different text sizes

I'd like to point out that this is not a Gmail specific issue but rather it depends on font size. Also, different font-families make a little difference in how the underlining renders. 

The attached test case shows 2 textareas with two different font sizes. 13px Arial is what Gmail uses in their email body. 

Also, as you make text bigger/smaller in the browser, the underlining changes to proper length.
Comment 4 Antti Koivisto 2007-02-22 12:18:29 PST
A comment in GraphicsContext::drawLineForMisspellingOrBadGrammar() says

// Make sure to draw only complete dots.
// NOTE: Code here used to shift the underline to the left and increase the width
// to make sure everything gets underlined, but that results in drawing out of
// bounds (e.g. when at the edge of a view) and could make it appear that the
// space between adjacent misspelled words was underlined.

Apparently underlining was made shorter on purpose. Still, perhaps it should at least be centered to make it look better? Anyway, doesn't seem like a P1.
Comment 5 mitz 2007-02-22 12:33:18 PST
In the 11px example, WebKit matches AppKit and it is not a regression from Safari 2.0.4. In the 13px example, AppKit extends the line by one dot to the right (tested in Tiger). Seems like WebKit needs to use the same logic and draw more dots.
Comment 6 Andrew Wellington 2007-02-26 02:45:10 PST
While it is simple enough to make WebKit draw a longer line that matches AppKit, this reintroduces the problem solved in r8649 (rdar://problem/3943090) where the line isn't completely erased in some circumstances. To solve that problem the code that removes markers (misspelling is removed by removing a marker from the document) will need to repaint slightly more than just the node in question or it will leave fragments of the line in some cases.
Comment 7 Maciej Stachowiak 2007-02-27 19:34:53 PST
<rdar://problem/5028156>
Comment 8 Darin Adler 2007-04-11 02:31:17 PDT
Despite the fact that this is a regression, it's costmetic and should not be marked P1.