Class Firebug.HTMLLib
Static utility class. Contains utilities used for displaying and
searching a HTML tree.
Defined in: htmlLib.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
Firebug.HTMLLib.findNextSibling(node)
Finds the next sibling of the given node.
|
| <static> |
Firebug.HTMLLib.findNodeAttrBox(objectNodeBox, attrName)
Locates the attribute domplate node for a given element domplate.
|
| <static> |
Firebug.HTMLLib.getSourceHref(element)
Retrieves the source URL for any external resource associated with a node.
|
| <static> |
Firebug.HTMLLib.getSourceText(element)
Retrieves the source text for inline script and style elements.
|
| <static> |
Firebug.HTMLLib.getTextElementTextBox(nodeBox)
Locates the text domplate node for a given text element domplate.
|
| <static> |
Firebug.HTMLLib.hasCommentChildren(element)
Determines if the given node has any children which are comments.
|
| <static> |
Firebug.HTMLLib.hasNoElementChildren(element)
Determines if the given node has any children which are elements.
|
| <static> |
Firebug.HTMLLib.isContainerElement(element)
Determines if the given element is a container element.
|
| <static> |
Firebug.HTMLLib.isEmptyElement(element)
Determines if a given element is empty.
|
| <static> |
Firebug.HTMLLib.isSourceElement(element)
Determines if the given element is the source for a non-DOM resource such
as Javascript source or CSS definition.
|
| <static> |
Firebug.HTMLLib.isWhitespaceText(node)
Determines if the given node consists solely of whitespace text.
|
Method Detail
<static>
Firebug.HTMLLib.findNextSibling(node)
Finds the next sibling of the given node. If the
Firebug#showTextNodesWithWhitespace parameter is set to true, the next
sibling may be a whitespace, otherwise the next is the first adjacent
non-whitespace node.
- Parameters:
- {Node} node
- Node to analyze.
- Returns:
- Next sibling node, if one exists
<static>
Firebug.HTMLLib.findNodeAttrBox(objectNodeBox, attrName)
Locates the attribute domplate node for a given element domplate. This method will
only examine notes marked with the "nodeAttr" class that are the direct
children of the given element.
- Parameters:
- {Object} objectNodeBox
- The domplate element to look up the attribute for.
- {String} attrName
- Attribute name
- Returns:
- Attribute's domplate node
<static>
Firebug.HTMLLib.getSourceHref(element)
Retrieves the source URL for any external resource associated with a node.
- Parameters:
- {Element} element
- Element to examine
- Returns:
- URL of the external resouce.
<static>
Firebug.HTMLLib.getSourceText(element)
Retrieves the source text for inline script and style elements.
- Parameters:
- {Element} element
- Script or style element
- Returns:
- Source text
<static>
Firebug.HTMLLib.getTextElementTextBox(nodeBox)
Locates the text domplate node for a given text element domplate.
- Parameters:
- {Object} nodeBox
- Text element domplate
- Returns:
- Element's domplate text node
<static>
Firebug.HTMLLib.hasCommentChildren(element)
Determines if the given node has any children which are comments.
- Parameters:
- {Element} element
- Element to test.
- Returns:
- true if immediate children of type Comment exist, false otherwise
<static>
Firebug.HTMLLib.hasNoElementChildren(element)
Determines if the given node has any children which are elements.
- Parameters:
- {Element} element
- Element to test.
- Returns:
- true if immediate children of type Element exist, false otherwise
<static>
Firebug.HTMLLib.isContainerElement(element)
Determines if the given element is a container element.
- Parameters:
- {Element} element
- Element to test
- Returns:
- True if the element is a container element.
<static>
Firebug.HTMLLib.isEmptyElement(element)
Determines if a given element is empty. When the
Firebug#showTextNodesWithWhitespace parameter is true, an element is
considered empty if it has no child elements and is self closing. When
false, an element is considered empty if the only children are whitespace
nodes.
- Parameters:
- {Element} element
- Element to test
- Returns:
- true if the element is empty, false otherwise
<static>
Firebug.HTMLLib.isSourceElement(element)
Determines if the given element is the source for a non-DOM resource such
as Javascript source or CSS definition.
- Parameters:
- {Element} element
- Element to test
- Returns:
- true if the element is a source element
<static>
Firebug.HTMLLib.isWhitespaceText(node)
Determines if the given node consists solely of whitespace text.
- Parameters:
- {Node} node
- Node to test.
- Returns:
- true if the node is a whitespace text node