Closed
Bug 456282
Opened 18 years ago
Closed 18 years ago
getStartPositionOfChar calculates advances in incorrect coordinate system
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: longsonr)
References
Details
Attachments
(3 files, 1 obsolete file)
|
1.55 KB,
application/xhtml+xml
|
Details | |
|
629 bytes,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
|
747 bytes,
patch
|
Details | Diff | Splinter Review |
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).
| Reporter | ||
Comment 1•18 years ago
|
||
I think the relevant code is here:
http://hg.mozilla.org/mozilla-central/annotate/78beaa82e920/layout/svg/base/src/nsSVGGlyphFrame.cpp#l821
| Assignee | ||
Comment 2•18 years ago
|
||
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+
| Assignee | ||
Comment 4•18 years ago
|
||
| Assignee | ||
Updated•18 years ago
|
OS: Linux → All
Hardware: PC → All
| Assignee | ||
Comment 5•18 years ago
|
||
Attachment #340744 -
Attachment is obsolete: true
| Assignee | ||
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•