Text

The Text interface inherits from CharacterData and represents the textual content (termed character data in XML) of an Element or Attr. If there is no markup inside an element's content, the text is contained in a single object implementing the Text interface that is the only child of the element. If there is markup, it is parsed into the information items (elements, comments, etc.) and Text nodes that form the list of children of the element.

Members

Functions

replaceWholeText
Text replaceWholeText(DOMString content)

Couldn't find in DOM documentation, but leavint it there.

splitText
Text splitText(size_t offset)

Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings. After being split, this node will contain all the content up to the offset point. A new node of the same type, which contains all the content at and after the offset point, is returned. If the original node had a parent node, the new node is inserted as the next sibling of the original node. When the offset is equal to the length of this node, the new node has no data.

Properties

isElementContentWhitespace
bool isElementContentWhitespace [@property getter]

Returns whether this text node contains element content whitespace, often abusively called "ignorable whitespace".

wholeText
DOMString wholeText [@property getter]

Returns the combined data of all direct text node siblings.

Inherited Members

From CharacterData

data
DOMString data [@property getter]
Undocumented in source.
data
DOMString data [@property setter]
Undocumented in source.
length
size_t length [@property getter]
Undocumented in source.
substringData
DOMString substringData(size_t offset, size_t count)

Extracts a substring of data starting at offset, with length count.

appendData
void appendData(DOMString arg)

Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the DOMString specified.

insertData
void insertData(size_t offset, DOMString arg)

Insert a string at the specified offset.

deleteData
void deleteData(size_t offset, size_t count)

Remove a range of characters from the node. Upon success, data and length reflect the change.

replaceData
void replaceData(size_t offset, size_t count, DOMString arg)

Replace count characters starting at the specified offset with the specified string.

Meta