Bug 3466 - ATSUI text doesn't render at coordinates greater than 32K
Summary: ATSUI text doesn't render at coordinates greater than 32K
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Darin Adler
Depends on:
Reported: 2005-06-12 09:11 PDT by mitz
Modified: 2005-11-04 00:29 PST (History)
2 users (show)

See Also:

testcase (355 bytes, text/html)
2005-06-12 09:12 PDT, mitz
no flags Details
Demonstrates a fix strategy (1.50 KB, patch)
2005-06-12 09:15 PDT, mitz
no flags Details | Formatted Diff | Diff
Proposed fix (1.68 KB, patch)
2005-06-19 07:16 PDT, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-06-12 09:11:22 PDT
Summary: All text that ATSUI needs to draw at an X or Y coordinate (or both) greater or equal to 32768 
gets drawn at 32768 (for that coordinate). The result is no text at the bottom of long pages (because 
it's all moved upwards).

Reproducible: Always.

To reproduce: Open the test-case, ATSUICoordinateLimits.html, in Safari and press the End key to scroll 
to the bottom.

Expected: no text inside the yellow rect, and Hebrew letters to appear between "here: " and ", not" in the 
bottom line.

Actual: Hebrew letters that were supposed to be in the bottom line are drawn inside the yellow rect (but 
in the correct horizontal position). If the page is scroll up and down to the bottom again by dragging 
the scroll thumb, then those Hebrew letters are no longer visible anywhere.

Analysis: The problem is that ATSUDrawText only accepts coordinates smaller than 32768 in absolute 
value. Greater values are truncated to 32768. A possible solution is to reach larger coordinates by 
translating the graphics context's CTM prior to calling ATSUDrawText. I will attach an (inefficient, non-
elegant) patch that uses this technique to successfully solve the problem.
Comment 1 mitz 2005-06-12 09:12:37 PDT
Created attachment 2265 [details]
Comment 2 mitz 2005-06-12 09:15:49 PDT
Created attachment 2266 [details]
Demonstrates a fix strategy
Comment 3 mitz 2005-06-19 07:16:39 PDT
Created attachment 2471 [details]
Proposed fix

Essentially the same patch
Comment 4 Darin Adler 2005-06-19 11:47:01 PDT
Comment on attachment 2471 [details]
Proposed fix

Looks fine to me, r=me.

There are spaces after the "(" and before the ")" characters that shouldn't be
there, so when landing this, that should be fixed.