Bug 14972 - Moving cursor down in contentEditable section fails if styled line-height:1em
Summary: Moving cursor down in contentEditable section fails if styled line-height:1em
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2007-08-15 07:46 PDT by ben
Modified: 2007-08-25 05:32 PDT (History)
4 users (show)

See Also:


Attachments
html file illustrating problem (2.48 KB, text/html)
2007-08-15 07:47 PDT, ben
no flags Details
Change RenderText hit testing to prefer the lower of two overlapping lines (4.09 KB, patch)
2007-08-15 12:31 PDT, mitz
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ben 2007-08-15 07:46:48 PDT
In r25065 and below, moving the cursor down in a contentEditable section doesn't work properly if the paragraph has CSS style line-height:1em;.

See attached; to reproduce, click in editable area, press the down arrow key.
Comment 1 ben 2007-08-15 07:47:38 PDT
Created attachment 15979 [details]
html file illustrating problem
Comment 2 David Kilzer (:ddkilzer) 2007-08-15 09:34:56 PDT
Confirmed with a local debug build of WebKit r25066 with Safari 3 Public Beta v. 3.0.3 (522.12.1) on Mac OS X 10.4.10 (8R218).  This also reproduces on Safari 2.0.4 (419.3) with its original WebKit on 10.4.10, so it's not a regression.

Also note the "lip" at the bottom of the <iframe> which bleeds through contents of the iframe!  That looks like a different bug, although it's also present on Safari 2.0.4 as well.

Comment 3 mitz 2007-08-15 12:31:07 PDT
Created attachment 15984 [details]
Change RenderText hit testing to prefer the lower of two overlapping lines

No layout test regressions, but it is perhaps worth mentioning that a more local fix is possible by patching nextLinePosition() to pass a lower y coordinate to positionForCoordinates().
Comment 4 Dave Hyatt 2007-08-22 13:52:05 PDT
Comment on attachment 15984 [details]
Change RenderText hit testing to prefer the lower of two overlapping lines

r=me
Comment 5 Mark Rowe (bdash) 2007-08-25 05:32:07 PDT
Landed in r25235.
Comment 6 Mark Rowe (bdash) 2007-08-25 05:32:48 PDT
<rdar://problem/5437710>