Closed Bug 456282 Opened 18 years ago Closed 18 years ago

getStartPositionOfChar calculates advances in incorrect coordinate system

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: longsonr)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached file testcase —
SVG text elements have APIs for getStartPositionOfChar and getEndPositionOfChar. These APIs are described at http://www.w3.org/TR/2003/REC-SVG11-20030114/text.html#InterfaceSVGTextContentElement , which says that the positions are in the user coordinate system for rendering the characters. We seem to do this correctly for getEndPositionOfChar, but not for getStartPositionOfChar. At least, our results are pretty close to Opera's for getEndPositionOfChar on the attached testcase, but very different for getStartPositionOfChar. Furthermore, I'd expect getStartPositionOfChar(n+1) to yield the same result as getEndPositionOfChar(n). (Note that we do get that result if I shrink the viewbox and all the numbers in the testcase by a factor of ten so that user coordinates are the same as pixels.) I think this bug contributes to failing Acid3 test 77 (and probably also test 79), although the lack of support for SVG fonts is the main issue there. Steps to reproduce: load attached testcase Expected results: The numbers for the end position of one character are the same as the numbers for the start position of the next character, and the x positions of the characters increase by 200-600 per character (given the font-size of 700). Actual results: The end positions are correct, but the start positions are advancing by about a factor of 10 less than they should. (Works as I expect in Opera 9.52.) I'm testing on a trunk debug build from this morning with my local patches (unrelated to this issue).
Attached patch patch — — Splinter Review
Assignee: nobody → longsonr
Attachment #340710 - Flags: superreview?(roc)
Attachment #340710 - Flags: review?(roc)
Comment on attachment 340710 [details] [diff] [review] patch Could you add a test for this?
Attachment #340710 - Flags: superreview?(roc)
Attachment #340710 - Flags: superreview+
Attachment #340710 - Flags: review?(roc)
Attachment #340710 - Flags: review+
OS: Linux → All
Hardware: PC → All
Attachment #340744 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
mochitest change checked in as 1f21b47c85be
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: