goog.editor.node
Namespace.findHighestMatchingAncestor(node, hasProperty)
Search ancestor nodes using a predicate function and returns the topmost ancestor in the chain of consecutive ancestors that satisfies the condition.
node
{Node
}
hasProperty
{function
(Node
): boolean
}
Node
}
.findInChildren(parent, hasProperty)
Search child nodes using a predicate function and return the first node that satisfies the condition.
parent
{Node
}
hasProperty
{function
(Node
):boolean
}
number
}
.findTopMostEditableAncestor(node, criteria)
Finds the top-most DOM node inside an editable field that is an ancestor (or self) of a given DOM node and meets the specified criteria.
node
{Node
}
criteria
{function
(Node
) : boolean
}
Node
}
.getFirstChild(parent)
Version of firstChild that skips nodes that are entirely whitespace and comments.
parent
{Node
}
Node
}
.getLastChild(parent)
Version of lastChild that skips nodes that are entirely whitespace or comments. (Normally lastChild is a property of all DOM nodes that gives the last of the nodes contained directly in the reference node.)
parent
{Node
}
Node
}
.getLeftMostLeaf(parent)
Get the left-most non-ignorable leaf node of the given node.
parent
{Node
}
Node
}
.getLength(node)
Returns the length of the text in node if it is a text node, or the number of children of the node, if it is an element. Useful for range-manipulation code where you need to know the offset for the right side of the node.
node
{Node
}
number
}
.getNextSibling(sibling)
Version of nextSibling that skips nodes that are entirely whitespace or comments.
sibling
{Node
}
Node
}
.getPreviousSibling(sibling)
Version of previoussibling that skips nodes that are entirely whitespace or comments. (Normally previousSibling is a property of all DOM nodes that gives the sibling node, the node that is a child of the same parent, that occurs immediately before the reference node.)
sibling
{Node
}
Node
}
.getRightMostLeaf(parent)
Get the right-most non-ignorable leaf node of the given node.
parent
{Node
}
Node
}
.isAllNonNbspWhiteSpace(textNode)
Determine whether a node's text content is entirely whitespace.
textNode
{Node
}
boolean
}
.isBlockTag(node)
Checks if node is a block-level html element. The display css property is ignored.
node
{Node
}
boolean
}
.isEditable(node)
Checks if a node is inside an editable container.
node
{Node
}
boolean
}
.isEditableContainer(element)
Checks if an element is a top-level editable container (meaning that it itself is not editable, but all its child nodes are editable).
element
{Node
}
boolean
}
.isEmpty(node, opt_prohibitSingleNbsp)
Returns true if the node contains only whitespace and is not and does not contain any images, iframes or embed tags.
node
{Node
}
opt_prohibitSingleNbsp
{boolean
=}
boolean
}
.isImportant(node)
Determine if a node should be returned by the iterator functions.
node
{Node
}
boolean
}
.isStandardsMode(node)
Check if the node is in a standards mode document.
node
{Node
}
boolean
}
.skipEmptyTextNodes(node)
Skips siblings of a node that are empty text nodes.
node
{Node
}
Node
}
.splitDomTreeAt(currentNode, opt_secondHalf, opt_root)
Splits off a subtree.
currentNode
{!Node
}
opt_secondHalf
{Node
=}
opt_root
{Node
=}
Node
}
.transferChildren(newNode, oldNode)
[deprecated]Deprecated. Use goog.dom.append directly instead.
Appends all of oldNode's children to newNode. This removes all children from oldNode and appends them to newNode. oldNode is left with no children.
newNode
{!Node
}
oldNode
{Node
}