Don't copy nsITextContent into glyph frames

RESOLVED FIXED

Status

()

Core
SVG
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: longsonr, Assigned: longsonr)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

12 years ago
The characters in a text node are copied into the glyph frames which means we store each piece of svg text twice.
(Assignee)

Comment 1

12 years ago
Created attachment 228296 [details] [diff] [review]
patch

Get the text from the text content whenever we need it rather than keeping a copy.

Note that this patch changes whitespace handling. Consider the following example:

<text>ab<tspan> cde </tspan>fg</text>

Considering http://www.w3.org/TR/SVG/text.html#WhiteSpace and looking at the xml:space="default" case it seems to me that we should strip out the spaces around the tspan element. Currently we'd not strip either of these spaces.

Also includes an optimisation to get all character advances in one go rather than one at a time. Is the idl correct for that. Surely there is a better way to indicate I want a float ** argument.
Assignee: general → longsonr
Status: NEW → ASSIGNED
Attachment #228296 - Flags: review?(tor)
(Assignee)

Comment 2

12 years ago
Comment on attachment 228296 [details] [diff] [review]
patch

nsSVGGlyphFrame::GetCharacterPosition changes submitted under bug 343774
Attachment #228296 - Flags: review?(tor)
(Assignee)

Comment 3

12 years ago
Created attachment 229806 [details] [diff] [review]
patch
Attachment #228296 - Attachment is obsolete: true
Attachment #229806 - Flags: review?(tor)

Comment 4

12 years ago
Comment on attachment 229806 [details] [diff] [review]
patch

Update the uuid for nsISVGGlyphFragmentNode.

Use nsAutoString in GetCharacterData and GetNumberOfCharacters.

File a bug about looking at xml:spac if one doesn't already exist.

With those, r=tor.
Attachment #229806 - Flags: review?(tor) → review+
(Assignee)

Comment 5

12 years ago
Created attachment 229952 [details] [diff] [review]
address review comments

> Update the uuid for nsISVGGlyphFragmentNode.

Done.

> Use nsAutoString in GetCharacterData and GetNumberOfCharacters.

Done.

> File a bug about looking at xml:spac if one doesn't already exist.

bug 319786 already exists for it.
Attachment #229806 - Attachment is obsolete: true
Attachment #229952 - Flags: superreview?(roc)
Attachment #229952 - Flags: superreview?(roc) → superreview+
(Assignee)

Comment 6

12 years ago
Checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.