Bug 5415

Summary: Left border of selection highlight leaves behind a trail
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: VERIFIED FIXED    
Severity: Normal CC: ap
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
testcase
none
extended testcase
none
proposed patch darin: review+

mitz
Reported 2005-10-18 11:49:26 PDT
Summary: with certain fonts, contracting the selection by moving its start rightwards leaves trails of the highlight behind. To reproduce: open the testcase in Safari. Click and drag in one motion from the end of the line to its beginning (extending the selection leftwards) and all the way back to the end (contracting the selection). Expected result: no trails left behind. Actual result: when the left border of the highlight is moving to the right, it leaves behind 1px-wide trails. I think this happens because the clipping rect for the redraw is determined by WebCore using integral coordinates and drawing the highlight is done in WebTextRenderer using non-integral coordinates (or perhaps applying a different rounding rule).
Attachments
testcase (325 bytes, text/html)
2005-10-18 11:50 PDT, mitz
no flags
extended testcase (635 bytes, text/html)
2005-10-23 09:13 PDT, mitz
no flags
proposed patch (4.17 KB, patch)
2005-10-23 09:25 PDT, mitz
darin: review+
mitz
Comment 1 2005-10-18 11:50:49 PDT
Created attachment 4402 [details] testcase
mitz
Comment 2 2005-10-23 09:13:41 PDT
Created attachment 4448 [details] extended testcase Added RTL case.
mitz
Comment 3 2005-10-23 09:25:31 PDT
Created attachment 4449 [details] proposed patch This patch fixes the trails bug in the CoreGraphics code path for LTR and RTL text (highlighting for RTL text was entirely broken very recently) and in the ATSUI code path for LTR text (highlighting and hit-testing RTL text in the ATSUI path is broken and I'll open a separate bug for it. I already have a patch). This patch eliminates the single-character-range special case in the rounding hack. One layout test is affected: fast/text/international/bidi-explicit-embedding . The new results should replace the current expected results.
Darin Adler
Comment 4 2005-10-23 15:25:44 PDT
Comment on attachment 4449 [details] proposed patch Looks good. r=me
David Harrison
Comment 5 2005-10-24 12:40:10 PDT
Committed. Test case added as WebCore/manual-tests/drag_select_highlighting.html
Note You need to log in before you can comment on or make changes to this bug.