Bug 12290 - SVGTextContentElement is missing all its DOM methods
Summary: SVGTextContentElement is missing all its DOM methods
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Nikolas Zimmermann
: 15622 (view as bug list)
Depends on:
Reported: 2007-01-15 18:11 PST by Eric Seidel (no email)
Modified: 2007-11-19 05:46 PST (History)
6 users (show)

See Also:

testing the interface SVGTextContentElement (12.99 KB, image/svg+xml)
2007-01-16 05:51 PST, Andreas Neumann
no flags Details
correct rendering of the test in Apache Batik. (53.72 KB, image/png)
2007-01-16 05:52 PST, Andreas Neumann
no flags Details
Initial patch (20.53 KB, patch)
2007-11-15 14:32 PST, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Layout test results (233.17 KB, patch)
2007-11-15 14:56 PST, Nikolas Zimmermann
no flags Details | Formatted Diff | Diff
Updated patch (19.79 KB, patch)
2007-11-15 16:04 PST, Nikolas Zimmermann
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-01-15 18:11:41 PST
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.
Comment 1 Andreas Neumann 2007-01-16 05:48:59 PST
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.
Comment 2 Andreas Neumann 2007-01-16 05:51:11 PST
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
Comment 3 Andreas Neumann 2007-01-16 05:52:04 PST
Created attachment 12484 [details]
correct rendering of the test in Apache Batik.
Comment 4 Eric Seidel (no email) 2007-02-04 03:22:12 PST
Another example test:
Comment 5 Eric Seidel (no email) 2007-09-26 17:59:27 PDT
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.
Comment 6 Eric Seidel (no email) 2007-10-23 20:19:59 PDT
*** Bug 15622 has been marked as a duplicate of this bug. ***
Comment 7 Nikolas Zimmermann 2007-11-15 14:32:10 PST
Created attachment 17302 [details]
Initial patch
Comment 8 Nikolas Zimmermann 2007-11-15 14:56:18 PST
Created attachment 17303 [details]
Layout test results
Comment 9 Eric Seidel (no email) 2007-11-15 15:43:31 PST
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 10 Eric Seidel (no email) 2007-11-15 15:45:42 PST
Comment on attachment 17302 [details]
Initial patch

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.
Comment 11 Nikolas Zimmermann 2007-11-15 16:04:58 PST
Created attachment 17304 [details]
Updated patch

A much better version of selectSubString() thanks to the help of Justin & Harrison.
Comment 12 Eric Seidel (no email) 2007-11-16 02:54:56 PST
Comment on attachment 17304 [details]
Updated patch

Looks fine.
Comment 13 Nikolas Zimmermann 2007-11-19 05:46:51 PST
Landed in r27848.