|
static | parseHTML (string $html, bool $validateXMLNames=false) |
| Parse HTML, return the tree.
|
|
static | visitDOM (Node $node, callable $handler,... $args) |
| This is a simplified version of the DOMTraverser.
|
|
static | migrateChildren (Node $from, Node $to, ?Node $beforeNode=null) |
| Move 'from'.childNodes to 'to' adding them before 'beforeNode' If 'beforeNode' is null, the nodes are appended at the end.
|
|
static | childNodes (Node $n) |
| Many DOM implementations will de-optimize the representation of a Node if $node->childNodes is accessed, converting the linked list of node children to an array which is then expensive to mutate.
|
|
static | migrateChildrenBetweenDocs (Node $from, Node $to, ?Node $beforeNode=null) |
| Copy 'from'.childNodes to 'to' adding them before 'beforeNode' 'from' and 'to' belong to different documents.
|
|
static | assertElt (?Node $node) |
| Assert that this is a DOM element node.
|
|
static | isRemexBlockNode (?Node $node) |
|
static | isWikitextBlockNode (?Node $node) |
|
static | isFormattingElt (?Node $node) |
| Determine whether this is a formatting DOM element.
|
|
static | isQuoteElt (?Node $node) |
| Determine whether this is a quote DOM element.
|
|
static | isBody (?Node $node) |
| Determine whether this is the <body> DOM element.
|
|
static | isRemoved (?Node $node) |
| Determine whether this is a removed DOM node but Node object yet.
|
|
static | pathToRoot (Node $node) |
| Build path from a node to the root of the document.
|
|
static | nodeDepth (Node $node) |
| Compute the edge length of the path from $node to the root.
|
|
static | pathToSibling (Node $node, Node $sibling, bool $left) |
| Build path from a node to its passed-in sibling.
|
|
static | inSiblingOrder (Node $n1, Node $n2) |
| Check whether a node n1 comes before another node n2 in their parent's children list.
|
|
static | isAncestorOf (Node $n1, Node $n2) |
| Check that a node 'n1' is an ancestor of another node 'n2' in the DOM.
|
|
static | findAncestorOfName (Node $node, string $name) |
| Find an ancestor of $node with nodeName $name.
|
|
static | hasNameOrHasAncestorOfName (Node $node, string $name) |
| Check whether $node has $name or has an ancestor named $name.
|
|
static | matchNameAndTypeOf (Node $n, string $name, string $typeRe) |
| Determine whether the node matches the given nodeName and attribute value.
|
|
static | hasNameAndTypeOf (Node $n, string $name, string $type) |
| Determine whether the node matches the given nodeName and typeof attribute value; the typeof is given as string.
|
|
static | matchTypeOf (Node $n, string $typeRe) |
| Determine whether the node matches the given typeof attribute value.
|
|
static | matchRel (Node $n, string $relRe) |
| Determine whether the node matches the given rel attribute value.
|
|
static | hasTypeOf (Node $n, string $type) |
| Determine whether the node matches the given typeof attribute value.
|
|
static | hasRel (Node $n, string $rel) |
| Determine whether the node matches the given rel attribute value.
|
|
static | hasClass (Element $element, string $regex) |
|
static | addTypeOf (Element $node, string $type, bool $prepend=false) |
| Add a type to the typeof attribute.
|
|
static | addRel (Element $node, string $rel) |
| Add a type to the rel attribute.
|
|
static | removeTypeOf (Element $node, string $type) |
| Remove a type from the typeof attribute.
|
|
static | removeRel (Element $node, string $rel) |
| Remove a type from the rel attribute.
|
|
static | isFosterablePosition (?Node $n) |
| Check whether node is in a fosterable position.
|
|
static | isHeading (?Node $n) |
| Check whether node is a heading.
|
|
static | isList (?Node $n) |
| Check whether node is a list.
|
|
static | isListItem (?Node $n) |
| Check whether node is a list item.
|
|
static | isListOrListItem (?Node $n) |
| Check whether node is a list or list item.
|
|
static | isNestedInListItem (?Node $n) |
| Check whether node is nestee in a list item.
|
|
static | isNestedListOrListItem (?Node $n) |
| Check whether node is a nested list or a list item.
|
|
static | isMarkerMeta (Node $n, string $type) |
| Check a node to see whether it's a meta with some typeof.
|
|
static | hasElementChild (Node $node) |
| Check whether a node has any children that are elements.
|
|
static | hasBlockElementDescendant (Node $node) |
| Check if a node has a block-level element descendant.
|
|
static | isIEW (?Node $node) |
| Is a node representing inter-element whitespace?
|
|
static | isDocumentFragment (?Node $node) |
| Is a node a document fragment?
|
|
static | atTheTop (?Node $node) |
| Is a node at the top?
|
|
static | allChildrenAreTextOrComments (Node $node) |
| Are all children of this node text or comment nodes?
|
|
static | treeHasElement (Node $node, string $tagName, bool $checkRoot=false) |
| Check if the dom-subtree rooted at node has an element with tag name 'tagName' By default, the root node is not checked.
|
|
static | isTableTag (Node $node) |
| Is node a table tag (table, tbody, td, tr, etc.)?
|
|
static | selectMediaElt (Element $node) |
| Returns a media element nested in node
|
|
static | findHttpEquivHeaders (Document $doc) |
| Extract http-equiv headers from the HTML, including content-language and vary headers, if present.
|
|
static | addHttpEquivHeaders (Document $doc, array $headers) |
| Add or replace http-equiv headers in the HTML <head>.
|
|
static | extractInlinedContentVersion (Document $doc) |
|
static | addAttributes (Element $elt, array $attrs) |
| Add attributes to a node element.
|
|
static | appendToHead (Document $document, string $tagName, array $attrs=[]) |
| Create an element in the document head with the given attrs.
|
|
static | getFragmentInnerHTML (DocumentFragment $frag) |
| innerHTML and outerHTML are not defined on DocumentFragment.
|
|
static | setFragmentInnerHTML (DocumentFragment $frag, string $html) |
| innerHTML and outerHTML are not defined on DocumentFragment.
|
|
static | parseHTMLToFragment (Document $doc, string $html) |
|
static | isRawTextElement (Node $node) |
|
static | hasBlockTag (Node $n) |
| Is $n a block tag OR does the subtree rooted at $n have a block tag in it?
|
|
static | attributes (Element $element) |
|
static | isMetaDataTag (Element $node) |
|
static | stripPWrapper (string $ret) |
| Strip a paragraph wrapper, if any, before parsing HTML to DOM.
|
|
DOM utilities for querying the DOM.
This is largely independent of Parsoid although some Parsoid details (TokenUtils, inline content version) have snuck in.