Bug 5100

Summary: -[WebTextRenderer _ATSU_drawRun:...] does not check view flippedness
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: VERIFIED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
testcase
none
flip coordinates when necessary
darin: review-
flip coordinates when necessary
none
flip coordinates when necessary darin: review+

Description mitz 2005-09-22 11:54:02 PDT
-[WebTextRenderer _ATSU_drawRun:style:geometry] does not check and compensate when drawing into a 
flipped view, resulting in flipped text in some cases.

To reproduce: open the testcase in Safari and drag each one of the links.
Expected: the link text to appear correctly in the drag image of each link.
Actual: in the first link's drag image, the link text is flipped horizontally.
Comment 1 mitz 2005-09-22 11:54:39 PDT
Created attachment 4009 [details]
testcase
Comment 2 mitz 2005-09-22 12:25:40 PDT
Created attachment 4011 [details]
flip coordinates when necessary

Note that it needs to flip when the view is unflipped, since the ATSUStyle
itself always flips (see _initializeATSUStyle).
Comment 3 Darin Adler 2005-09-23 08:39:39 PDT
Comment on attachment 4011 [details]
flip coordinates when necessary

Formatting is wrong here. There should not be a space after the "(" in the if
statements. Otherwise, this looks great.
Comment 4 mitz 2005-09-23 08:50:02 PDT
Created attachment 4016 [details]
flip coordinates when necessary
Comment 5 mitz 2005-09-23 08:55:15 PDT
Created attachment 4017 [details]
flip coordinates when necessary
Comment 6 mitz 2005-09-23 08:58:38 PDT
Comment on attachment 4017 [details]
flip coordinates when necessary

Corrected style and use of params.layout instead of layout
Comment 7 Darin Adler 2005-09-23 09:09:09 PDT
Comment on attachment 4017 [details]
flip coordinates when necessary

r=me
Comment 8 Darin Adler 2005-09-23 18:06:39 PDT
Thinking further on this, I think it's not so great to have the renderer depend on there being a currently-
focused NSView. Instead, the flippedness should be applied by the caller, or there should be a boolean 
passed in.

I have no objection to landing this patch first, but it's not a good long-term solution. The renderer code 
should be independent of NSView.