-[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.
Created attachment 4009 [details] testcase
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 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.
Created attachment 4016 [details] flip coordinates when necessary
Created attachment 4017 [details] flip coordinates when necessary
Comment on attachment 4017 [details] flip coordinates when necessary Corrected style and use of params.layout instead of layout
Comment on attachment 4017 [details] flip coordinates when necessary r=me
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.