Bug 12812 - REGRESSION: In Gmail Check Spelling As you Type underline doesn't cover certain words
Summary: REGRESSION: In Gmail Check Spelling As you Type underline doesn't cover certa...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://mail.google.com/mail/
Keywords: InRadar
Depends on:
Reported: 2007-02-19 09:38 PST by Stephen Harbage
Modified: 2007-12-10 06:34 PST (History)
3 users (show)

See Also:

Ruth example 1 (3.09 KB, image/tiff)
2007-02-19 09:39 PST, Stephen Harbage
no flags Details
Ruth example 2 (18.16 KB, image/tiff)
2007-02-19 09:40 PST, Stephen Harbage
no flags Details
Text areas showing different text sizes (411 bytes, text/html)
2007-02-20 21:23 PST, Vladimir Olexa (vladinecko)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Harbage 2007-02-19 09:38:19 PST
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:

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.

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
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.