(From update of attachment 272746)
One general comment.
I think it would be better all round if you tried to adapt the existing character placement mechanism used for textPath elements rather than having two separate implementations. i.e. use nsSVGCharacterPosition and make GetCharacterPosition return character positions if you have multiple y values. You may need to consider extending this so that you can have multiple characters with a single position for the first one so that you can write a string abcde with positions "x y" as character a at position x and then bcde in one go at position y.
If you change an interface you must update its ID i.e.
// {2C466AED-CF7B-4479-A807-98151215A645}
#define NS_ISVGGLYPHFRAGMENTLEAF_IID \
{ 0x2c466aed, 0xcf7b, 0x4479, { 0xa8, 0x7, 0x98, 0x15, 0x12, 0x15, 0xa6, 0x45 } }
How many of these new members are absolutely mandatory? Most text will not have multiple x and y positions so we don't want to pay for that all the time. Neither do we want to store anything we can easily calculate.
(From update of attachment 272746)
One general comment.
I think it would be better all round if you tried to adapt the existing character placement mechanism used for textPath elements rather than having two separate implementations. i.e. use nsSVGCharacterP osition and make GetCharacterPos ition return character positions if you have multiple y values. You may need to consider extending this so that you can have multiple characters with a single position for the first one so that you can write a string abcde with positions "x y" as character a at position x and then bcde in one go at position y.
>Index: layout/ svg/base/ src/nsISVGGlyph FragmentLeaf. h ======= ======= ======= ======= ======= ======= ======= ======= ===== n(float x, float y)=0; n(float x, float y, PRUint16 baseline)=0; ition(float *x, float *y)=0;
>======
...
>- NS_IMETHOD_(void) SetGlyphPositio
>+ NS_IMETHOD_(void) SetGlyphPositio
>+ NS_IMETHOD_(void) GetNextGlyphPos
If you change an interface you must update its ID i.e. CF7B-4479- A807-98151215A6 45} GMENTLEAF_ IID \
// {2C466AED-
#define NS_ISVGGLYPHFRA
{ 0x2c466aed, 0xcf7b, 0x4479, { 0xa8, 0x7, 0x98, 0x15, 0x12, 0x15, 0xa6, 0x45 } }
> nsSVGGlyphFrame ::nsSVGGlyphFra me(nsStyleConte xt* aContext) Base(aContext) , ling(COMPRESS_ WHITESPACE)
> : nsSVGGlyphFrame
> mWhitespaceHand
> {
>+ mDoCharPlacement = PR_FALSE;
>+ mStrLength = 0;
Initialise member variables in the initialiser bit rather than the constructor body c.f. mWhitespaceHandling above. However see below.
>Index: layout/ svg/base/ src/nsSVGGlyphF rame.h ======= ======= ======= ======= ======= ======= ======= ======= ===== mozilla/ layout/ svg/base/ src/nsSVGGlyphF rame.h, v svg/base/ src/nsSVGGlyphF rame.h 4 Jul 2007 03:39:03 -0000 1.25 svg/base/ src/nsSVGGlyphF rame.h 18 Jul 2007 04:32:36 -0000 gfxFontGroup> mFontGroup; gfxFontStyle> mFontStyle; ling; nsSVGBaselinePo sition> mBaselinePositions;
>======
>RCS file: /cvsroot/
>retrieving revision 1.25
>diff -u -8 -p -r1.25 nsSVGGlyphFrame.h
>--- layout/
>+++ layout/
>@@ -114,29 +114,30 @@ public:
> nsRefPtr<
> nsAutoPtr<
> gfxPoint mPosition;
> PRUint8 mWhitespaceHand
>+ nsAutoArrayPtr<
>+ PRBool mDoCharPlacement; // do per character placement
This bloats the class size. Reuse the textPath mechanism and calculate this when you need it.
Also don't use PRBool as a class member, use PRPackedBool.
And finally order any member variables in sizeof order to ensure minimal sizeof of the class as a whole.
>+ gfxPoint mNextGlyphPosition;
>+ float mBaselineOffset;
>+ PRUint32 mStrLength;
mStrLength just bloats the class size.
How many of these new members are absolutely mandatory? Most text will not have multiple x and y positions so we don't want to pay for that all the time. Neither do we want to store anything we can easily calculate.