Bug 18046 - SVGTextElement.getStartPositionOfChar does not correctly account for multichar glyphs
Summary: SVGTextElement.getStartPositionOfChar does not correctly account for multicha...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks: 18031
  Show dependency treegraph
 
Reported: 2008-03-24 13:38 PDT by Maciej Stachowiak
Modified: 2008-03-24 17:36 PDT (History)
0 users

See Also:


Attachments
handle multichar glyph metrics and rendering correctly (53.34 KB, patch)
2008-03-24 14:21 PDT, Maciej Stachowiak
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2008-03-24 13:38:01 PDT
SVGTextElement.getStartPositionOfChar counts the advance of each character in multichar glyphs individually. Instead, it should apply the advance of the whole glyph only after the last char of the multichar glyph, because SVG requires that characters all rendered as a unit are considered to have the same start position. This causes many problems on Acid3 test 79.
Comment 1 Maciej Stachowiak 2008-03-24 14:21:43 PDT
Created attachment 20013 [details]
handle multichar glyph metrics and rendering correctly
Comment 2 Eric Seidel (no email) 2008-03-24 14:45:32 PDT
Comment on attachment 20013 [details]
handle multichar glyph metrics and rendering correctly

Looks like you added a space before svgTextRunForInlineTextBox by accident. 

 LayoutTests/platform/mac/svg/text/multichar-glyph-expected.txt  is displaying an XML error (when it really probably should dump as text, no?)

It's possible to write SVG tests which use the shouldBe() stuff, and are js files, but it's not possible to have a custom SVG template.  Your copy/paste of shouldBe is less than ideal, but also OK.
Comment 3 Eric Seidel (no email) 2008-03-24 16:57:51 PDT
Comment on attachment 20013 [details]
handle multichar glyph metrics and rendering correctly

Aside from my two corrections above, the patch looks sane.  extraCharsAvailable could be part of TextRun, but you had performance concerns.  I think it's OK to not have it part of TextRun (at least for now).
Comment 4 Maciej Stachowiak 2008-03-24 17:36:17 PDT
Thanks. I fixed the two issues above before landing.