SVGTextContentElement needs implementations for the following methods:
Oliver and I talked about this on IRC, we expect them all to be pretty trivial (ignoring text-on-path or any other currently-unsupported layout for the moment).
long getNumberOfChars() const;
float getComputedTextLength() const;
float getSubStringLength(unsigned long charnum, unsigned long nchars, ExceptionCode&) const;
FloatPoint getStartPositionOfChar(unsigned long charnum, ExceptionCode&) const;
FloatPoint getEndPositionOfChar(unsigned long charnum, ExceptionCode&) const;
FloatRect getExtentOfChar(unsigned long charnum, ExceptionCode&) const;
float getRotationOfChar(unsigned long charnum, ExceptionCode&) const;
long getCharNumAtPosition(const FloatPoint&) const;
void selectSubString(unsigned long charnum, unsigned long nchars, ExceptionCode&) const;
Oliver agreed to add pseudo-code for each to this bug. So I'm adding this as a master bug. If needed, we can break of individual bugs for each, of fix a few of them in this bug and file a second one.
http://www.carto.net/neumann/webkitsvgbugs/text-dom-01-f.svg is testing all methods and parts of the properties of the SVGTextContentElement. I also uploaded it as a testcase.
The testcase is in the W3C SVG testsuit format and will probably also be added to the testsuite.
I will probably later provide individual test cases if you want.
So far Apache Batik is the only SVG UA passing all the subtests. ASV3 passes most of the subtests.
Created attachment 12483 [details]
testing the interface SVGTextContentElement
http://www.carto.net/neumann/webkitsvgbugs/text-dom-01-f.png shows how the correct rendering looks like in Batik
Created attachment 12484 [details]
correct rendering of the test in Apache Batik.
Another example test:
I peaked at this again today. I expect this will be a couple hour hack for WildFox once he finds time. Eventually I'll spend the time to understand his fancy text-chunk system... but not tonight.
*** Bug 15622 has been marked as a duplicate of this bug. ***
Created attachment 17302 [details]
Created attachment 17303 [details]
Layout test results
Comment on attachment 17303 [details]
Layout test results
The layout test results look fine. They're of no use w/o the patch however, so just clearing the flag.
Comment on attachment 17302 [details]
This looks OK. We talked over IRC about a nicer design for the QueryWalker which used subclasses and specific variable names/methods instead of generic query variables. Possibly virtual methods or templates instead of a switch statement.
You're currently working out the nextPosition stuff with Harrison. When that's done we can review your final patch.
Created attachment 17304 [details]
A much better version of selectSubString() thanks to the help of Justin & Harrison.
Comment on attachment 17304 [details]
Landed in r27848.