Bug 6132

Summary: Incorrect selection highlighting for ATSUI text when selected range is "CG-safe"
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: VERIFIED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on:    
Bug Blocks: 5166    
Attachments:
Description Flags
testcase
none
patch (incl. layout test) darin: review+

Description mitz 2005-12-18 09:21:18 PST
[Split off from bug 5166]
Summary: The selection highlight is partial or offset when the selection consists of "CG-safe" characters 
only but it is preceded by "need-ATSUI" characters.

To reproduce: double-click "dolor" in the testcase.

The position of the highlight rectangle depends on the width of all text before the selection, so the 
ATSUI code path should be used to draw the highlight even if the selected range itself does not require 
ATSUI.
The same applies to drawing text for the drag image when dragging a partial selection.

The fix for both is to change shouldUseATSU to always scan from the beginning. This should not affect 
layout and rendering performance, since run->from is zero anyway in all but the above two cases.
Comment 1 mitz 2005-12-18 09:23:16 PST
Created attachment 5133 [details]
testcase
Comment 2 mitz 2005-12-18 09:41:11 PST
Created attachment 5134 [details]
patch (incl. layout test)

Pixel mode required to detect regressions.
Comment 3 mitz 2005-12-18 14:14:02 PST
Comment on attachment 5134 [details]
patch (incl. layout test)

The code changes in this patch are identical to those in attachment 4965 [details].
Comment 4 Darin Adler 2005-12-18 14:31:50 PST
Comment on attachment 5134 [details]
patch (incl. layout test)

r=me