firstDaisy Diff compare report.
Click on the changed parts for a detailed description. Use the left and right arrow keys to walk through the modifications.
last 

10.

19 DOM interfaces

The following interfaces are defined below: SVGTextContentElement, SVGTextPositioningElement, SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGTextPathElement, SVGAltGlyphElement, SVGAltGlyphDefElement, SVGAltGlyphItemElement, SVGGlyphRefElement.

17 DOM interfaces

10.17.1 Interface SVGTextContentElement

The SVGTextContentElement interface is inherited by various text-related interfaces, such as SVGTextElement, SVGTSpanElement, SVGTRefElement, SVGAltGlyphElement and SVGTextPathElement. IDL Definition
interface SVGTextContentElement : SVGElement,
                
SVGElement,
                  SVGTests,
                                  SVGLangSpace,
                                  SVGExternalResourcesRequired,
                                  SVGStylable,
                
events::
                  EventTarget {

  // lengthAdjust Types
  
const
unsigned short LENGTHADJUST_UNKNOWN 
= 0;
  
const
unsigned short LENGTHADJUST_SPACING 
= 1;
  
const
unsigned short LENGTHADJUST_SPACINGANDGLYPHS 
= 2;

  readonly attribute SVGAnimatedLength 
textLength;
  readonly attribute SVGAnimatedEnumeration lengthAdjust;

  long 
getNumberOfChars
(
);
  float 
getComputedTextLength
(
);
  float 
getSubStringLength
(
in unsigned long charnum, in unsigned long nchars
) 
raises(
DOMException
);
  SVGPoint getStartPositionOfChar
(
in unsigned long charnum
) 
raises(
DOMException
);
  SVGPoint getEndPositionOfChar
(
in unsigned long charnum
) 
raises(
DOMException
);
  SVGRect 
getExtentOfChar
(
in unsigned long charnum
) 
raises(
DOMException
);
  float 
getRotationOfChar
(
in unsigned long charnum
) 
raises(
DOMException
);
  long 
getCharNumAtPosition
(
in SVGPoint point
);
  void 
selectSubString
(
in unsigned long charnum, in unsigned long nchars
) 
raises(
DOMException
);
};
Definition group lengthAdjust Types
Defined constants
Constants in group “lengthAdjust Types”:
LENGTHADJUST_UNKNOWN (unsigned short)
The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
LENGTHADJUST_SPACING (unsigned short)
Corresponds to value 'spacing'.
LENGTHADJUST_SPACINGANDGLYPHS (unsigned short)
Corresponds to value 'spacingAndGlyphs'.
Attributes:
textLength (readonly SVGAnimatedLength
textLength
)
Corresponds to attribute 'textLength' on the given element.
lengthAdjust (readonly SVGAnimatedEnumeration
lengthAdjust
)
Corresponds to attribute 'lengthAdjust' on the given element. The value must be one of the length adjust constants
specified above.
Methods
getNumberOfChars
long
defined on this interface.
Operations:
long getNumberOfChars()
Returns the total number of characters to be rendered within the current element. Includes characters which are included via a 'tref' reference.
No Parameters
Return value
Returns
Total number of characters.
No Exceptions
Return value
float
float getComputedTextLength()
The total sum of all of the advance values from rendering all of the characters within this element, including the advance value on the glyphs (horizontal or vertical), the effect of properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due to attributes 'dx' and 'dy' on 'tspan' elements. For non-rendering environments, the user agent shall make reasonable assumptions about glyph metrics.
No Parameters
Returns
The text advance distance.
No Exceptions
getSubStringLength
float getSubStringLength(in unsigned long charnum, in unsigned long nchars)
The total sum of all of the advance values from rendering the specified substring of the characters, including the advance value on the glyphs (horizontal or vertical), the effect of properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due to attributes 'dx' and 'dy' on 'tspan' elements. For non-rendering environments, the user agent shall make reasonable assumptions about glyph metrics.
Parameters
in
  1. unsigned long charnum
    The index of the first character in the substring, where the first character has an index of 0.
in float
  1. unsigned long nchars
    The number of characters in the substring.
Return value
Returns
The text advance distance.
Exceptions
DOMException, code INDEX_SIZE_ERR
:
Raised if the charnum is negative
or
of if charnum+nchars is greater than or equal to the number of characters at this node.
SVGPoint getStartPositionOfChar(in unsigned long charnum)
Returns the current text position before rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The current text position has already taken into account the effects of any inter-character adjustments due to properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due to attributes 'x', 'y', 'dx' and 'dy'. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the start position for the first glyph.
Parameters
in SVGPoint
  1. unsigned long charnum
    The index of the character, where the first character has an index of 0.
Return value
Returns
The character's start position.
Exceptions
DOMException, code INDEX_SIZE_ERR
:
Raised if the charnum is negative
or
of if charnum is greater than or equal to the number of characters at this node.
SVGPoint getEndPositionOfChar(in unsigned long charnum)
Returns the current text position after rendering the character in the user coordinate system for rendering the glyph(s) that correspond to the specified character. This current text position does not take into account the effects of any inter-character adjustments to prepare for the next character, such as properties 'kerning', 'letter-spacing' and 'word-spacing' and adjustments due to attributes 'x', 'y', 'dx' and 'dy'. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the end position for the last glyph.
Parameters
in SVGPoint
  1. unsigned long charnum
    The index of the character, where the first character has an index of 0.
Return value
Returns
The character's end position.
Exceptions
DOMException, code INDEX_SIZE_ERR
:
Raised if the charnum is negative
or
of if charnum is greater than or equal to the number of characters at this node.
SVGRect getExtentOfChar(in unsigned long charnum)
Returns a tightest rectangle which defines the minimum and maximum X and Y values in the user coordinate system for rendering the glyph(s) that correspond to the specified character. The calculations assume that all glyphs occupy the full standard glyph cell for the font. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the same extent.
Parameters
in SVGRect
  1. unsigned long charnum
    The index of the character, where the first character has an index of 0.
Return value
Returns
The rectangle which encloses all of the rendered glyph(s).
Exceptions
DOMException, code INDEX_SIZE_ERR
:
Raised if the charnum is negative
or
of if charnum is greater than or equal to the number of characters at this node.
float getRotationOfChar(in unsigned long charnum)
Returns the rotation value relative to the current user coordinate system used to render the glyph(s) corresponding to the specified character. If multiple glyph(s) are used to render the given character and the glyphs each have different rotations (e.g., due to text-on-a-path), the user agent shall return an average value (e.g., the rotation angle at the midpoint along the path for all glyphs used to render this character). The rotation value represents the rotation that is supplemental to any rotation due to properties 'glyph-orientation-horizontal' and 'glyph-orientation-vertical'; thus, any glyph rotations due to these properties are not included into the returned rotation value. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then each of the inseparable characters will return the same rotation value.
Parameters
in float
  1. unsigned long charnum
    The index of the character, where the first character has an index of 0.
Return value
Returns
The rotation angle.
Exceptions
DOMException, code INDEX_SIZE_ERR
:
Raised if the charnum is negative
or
of if charnum is greater than or equal to the number of characters at this node.
long getCharNumAtPosition(in SVGPoint point)
Returns the index of the character whose corresponding glyph cell bounding box contains the specified point. The calculations assume that all glyphs occupy the full standard glyph cell for the font. If no such character exists, a value of -1 is returned. If multiple such characters exist, the character within the element whose glyphs were rendered last (i.e., take into account any reordering such as for bidirectional text) is used. If multiple consecutive characters are rendered inseparably (e.g., as a single glyph or a sequence of glyphs), then the user agent shall allocate an equal percentage of the text advance amount to each of the contributing characters in determining which of the characters is chosen.
Parameters
in long
  1. SVGPoint point
    A point in user space.
Return value
selectSubString
Returns
The index of the character which is at the given point, where the first character has an index of 0.
No Exceptions
void selectSubString(in unsigned long charnum, in unsigned long nchars)
Causes the specified substring to be selected just as if the user selected the substring interactively.
Parameters
in
  1. unsigned long charnum
    The index of the
start
  1. first character
which is at the given point
  1. in the substring, where the first character has an index of 0.
in
Exceptions
DOMException
  1. unsigned long nchars
    The number of characters in the substring.
If nchars specifies more characters than are available, then the substring will consist of all characters starting with charnum until the end of the list of characters.
No Return Value
Exceptions
DOMException, code INDEX_SIZE_ERR
:
Raised if the charnum is negative
or
of if charnum+nchars is greater than or equal to the number of characters at this node.

10.17.2 Interface SVGTextPositioningElement

The SVGTextPositioningElement interface is inherited by text-related interfaces: SVGTextElement, SVGTSpanElement, SVGTRefElement and SVGAltGlyphElement. IDL Definition
interface SVGTextPositioningElement : SVGTextContentElement {
  
readonly attribute SVGAnimatedLengthList x;
  readonly attribute SVGAnimatedLengthList y;
  readonly attribute SVGAnimatedLengthList dx;
  readonly attribute SVGAnimatedLengthList dy;
  readonly attribute SVGAnimatedNumberList rotate;
};
Attributes:
x (readonly SVGAnimatedLengthList
x
)
Corresponds to attribute 'x' on the given element.
y (readonly SVGAnimatedLengthList
y
)
Corresponds to attribute 'y' on the given element.
dx (readonly SVGAnimatedLengthList
dx
)
Corresponds to attribute 'dx' on the given element.
dy (readonly SVGAnimatedLengthList
dy
)
Corresponds to attribute 'dy' on the given element.
rotate (readonly SVGAnimatedNumberList
rotate
)
Corresponds to attribute 'rotate' on the given element.

10.17.3 Interface SVGTextElement

The SVGTextElement interface corresponds to the 'text' element. IDL Definition
interface SVGTextElement : SVGTextPositioningElement,
                
SVGTextPositioningElement,
           
SVGTransformable {
};

10.17.4 Interface SVGTSpanElement

The SVGTSpanElement interface corresponds to the 'tspan' element. IDL Definition
interface SVGTSpanElement : SVGTextPositioningElement {
};

10.17.5 Interface SVGTRefElement

The SVGTRefElement interface corresponds to the 'tref' element. IDL Definition
interface SVGTRefElement : SVGTextPositioningElement,
                
SVGTextPositioningElement,
           
SVGURIReference {
};

10.17.6 Interface SVGTextPathElement

The SVGTextPathElement interface corresponds to the 'textPath' element. IDL Definition
interface SVGTextPathElement : SVGTextContentElement,
                
SVGTextContentElement,
               
SVGURIReference {

  // textPath Method Types
  
const
unsigned short TEXTPATH_METHODTYPE_UNKNOWN 
= 0;
  
const
unsigned short TEXTPATH_METHODTYPE_ALIGN 
= 1;
  
const
unsigned short TEXTPATH_METHODTYPE_STRETCH 
= 2;

  // textPath Spacing Types
  
const
unsigned short TEXTPATH_SPACINGTYPE_UNKNOWN 
= 0;
  
const
unsigned short TEXTPATH_SPACINGTYPE_AUTO 
= 1;
  
const
unsigned short TEXTPATH_SPACINGTYPE_EXACT 
= 2;

  readonly attribute SVGAnimatedLength 
startOffset;
  readonly attribute SVGAnimatedEnumeration method;
  readonly attribute SVGAnimatedEnumeration spacing;
};
Definition
Constants in group
textPath Method Types
Defined constants
“textPath Method Types”:
TEXTPATH_METHODTYPE_UNKNOWN(unsigned short)
The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
TEXTPATH_METHODTYPE_ALIGN(unsigned short)
Corresponds to value 'align'.
TEXTPATH_METHODTYPE_STRETCH(unsigned short)
Corresponds to value 'stretch'.
Definition
Constants in group
textPath Spacing Types
Defined constants
“textPath Spacing Types”:
TEXTPATH_SPACINGTYPE_UNKNOWN(unsigned short)
The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
TEXTPATH_SPACINGTYPE_AUTO(unsigned short)
Corresponds to value 'auto'.
TEXTPATH_SPACINGTYPE_EXACT(unsigned short)
Corresponds to value 'exact'.
Attributes:
startOffset (readonly SVGAnimatedLength
startOffset
)
Corresponds to attribute 'startOffset' on the given 'textPath' element.
method (readonly SVGAnimatedEnumeration
method
)
Corresponds to attribute 'method' on the given 'textPath' element.
The value must be one of the method type constants specified above.
spacing (readonly SVGAnimatedEnumeration
spacing
)
Corresponds to attribute 'spacing' on the given 'textPath' element.
The value must be one of the spacing type constants specified above.

10.17.7 Interface SVGAltGlyphElement

The SVGAltGlyphElement interface corresponds to the 'altGlyph' element. IDL Definition
interface SVGAltGlyphElement : SVGTextPositioningElement,
                
SVGTextPositioningElement,
               
SVGURIReference {
  
attribute DOMString glyphRef;
  
// raises DOMException on setting
attribute DOMString format;

// raises DOMException on setting
};
Attributes:
glyphRef (DOMString
glyphRefDOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.
DOMString format
)
Corresponds to attribute 'glyphRef' on the given element.
Exceptions on setting
format (DOMString)
Corresponds to attribute 'format' on the given element.
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.

10.17.8 Interface SVGAltGlyphDefElement

The SVGAltGlyphDefElement interface corresponds to the 'altGlyphDef' element. IDL Definition
interface SVGAltGlyphDefElement : SVGElement {
};

10.17.9 Interface SVGAltGlyphItemElement

The SVGAltGlyphItemElement interface corresponds to the 'altGlyphItem' element. IDL Definition
interface SVGAltGlyphItemElement : SVGElement {
};

10.17.10 Interface SVGGlyphRefElement

The SVGGlyphRefElement interface corresponds to the 'glyphRef' element. IDL Definition
interface SVGGlyphRefElement : SVGElement,
                
SVGElement,
               
SVGURIReference,
                
SVGStylable
 
{
             
attribute
 
DOMString
SVGStylable 
glyphRef;
{
  attribute DOMString glyphRef;
  
// raises DOMException on setting
attribute DOMString format;
  
// raises DOMException on setting
attribute float 
x;
  
// raises DOMException on setting
attribute float 
y;
  
// raises DOMException on setting
attribute float 
dx;
  
// raises DOMException on setting
attribute float 
dy;

// raises DOMException on setting
};
Attributes:
glyphRef (DOMString
glyphRefDOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.
DOMString format
)
Corresponds to attribute 'glyphRef' on the given element.
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.
float x
format (DOMString)
Corresponds to attribute 'format' on the given element.
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.
float y
x (float)
Corresponds to attribute 'x' on the given element.
Exceptions on setting
float dx
y (float)
Corresponds to attribute 'y' on the given element.
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.
float dy
dx (float)
Corresponds to attribute 'dx' on the given element.
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.
dy (float)
Corresponds to attribute 'dy' on the given element.
Exceptions on setting
DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised on an attempt to change the value of a readonly attribute.
SVG 1.1 (Second Edition) – 16 May 2009