Dodo
DOm DOcument implementation
Loading...
Searching...
No Matches
Wikimedia\Dodo\Internal\WhatWG Class Reference

Static Public Member Functions

static int compare_document_position (Node $node1, Node $node2)
 
static string locate_namespace (Node $node, ?string $prefix)
 
static string locate_prefix (Node $node, ?string $ns)
 
static insert_before_or_replace (Node $child, ContainerNode $parent, ?Node $before, bool $replace)
 
static ensure_insert_valid (Node $node, Node $parent, ?Node $child)
 TODO: Look at the way these were implemented in the original; there are some speedups esp in the way that you implement things like "node has a doctype child that is not child.
 
static ensure_replace_valid (Node $node, Node $parent, Node $child)
 
static descendantTextContent (Node $node, array &$bits)
 Return the "descendant text content" of the given node.
 
static string _helper_escape ( $s)
 
static string _helper_escapeAttr ( $s)
 
static string _helper_attrname (Attr $a)
 
static xmlSerialize (Node $node, array $options, array &$markup)
 The "XML serialization" algorithm.
 
static xmlSerializeElement (Element $el, ?string $namespace, NamespacePrefixMap $prefixMap, int &$prefixIndex, array $options, array &$markup)
 XML serializing an Element node.
 
static xmlSerializeAttributes (NamedNodeMap $attributes, NamespacePrefixMap $map, int &$prefixIndex, array &$localPrefixesMap, bool $ignoreNamespaceDefinitionAttribute, array $options, array &$markup)
 XML serialization of the attributes of an element.
 
static xmlSerializeAttrValue (?string $value, array $options, array &$markup)
 Serialize an attribute value (for XML).
 
static htmlSerialize (array &$result, Node $child, ?Node $parent, array $options=[])
 This is part of the "HTML fragment serialization algorithm".
 
static bool is_valid_xml_chars ( $s)
 
static bool is_valid_xml_name ( $s)
 
static bool is_valid_xml_qname ( $s)
 
static void validate_and_extract (?string &$ns, string $qname, ?string &$prefix, ?string &$lname)
 Validate and extract a namespace and qualifiedName.
 

Member Function Documentation

◆ _helper_attrname()

static string Wikimedia\Dodo\Internal\WhatWG::_helper_attrname ( Attr $a)
static
Parameters
Attr$a
Returns
string

◆ _helper_escape()

static string Wikimedia\Dodo\Internal\WhatWG::_helper_escape ( $s)
static
Parameters
string$s
Returns
string

◆ _helper_escapeAttr()

static string Wikimedia\Dodo\Internal\WhatWG::_helper_escapeAttr ( $s)
static
Parameters
string$s
Returns
string

◆ compare_document_position()

static int Wikimedia\Dodo\Internal\WhatWG::compare_document_position ( Node $node1,
Node $node2 )
static
See also
https://dom.spec.whatwg.org/#dom-node-comparedocumentposition
Parameters
Node$node1
Node$node2
Returns
int

◆ descendantTextContent()

static Wikimedia\Dodo\Internal\WhatWG::descendantTextContent ( Node $node,
array & $bits )
static

Return the "descendant text content" of the given node.

See also
https://dom.spec.whatwg.org/#concept-descendant-text-content
Parameters
Node$node
string[]&$bitsthe result is returned in this array

◆ ensure_insert_valid()

static Wikimedia\Dodo\Internal\WhatWG::ensure_insert_valid ( Node $node,
Node $parent,
?Node $child )
static

TODO: Look at the way these were implemented in the original; there are some speedups esp in the way that you implement things like "node has a doctype child that is not child.

Parameters
Node$node
Node$parent
?Node$child

◆ ensure_replace_valid()

static Wikimedia\Dodo\Internal\WhatWG::ensure_replace_valid ( Node $node,
Node $parent,
Node $child )
static
Parameters
Node$node
Node$parent
Node$child

◆ htmlSerialize()

static Wikimedia\Dodo\Internal\WhatWG::htmlSerialize ( array & $result,
Node $child,
?Node $parent,
array $options = [] )
static

This is part of the "HTML fragment serialization algorithm".

See also
https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
Parameters
array<string>&$result
Node$child
?Node$parentThis is null when evaluating outerHtml
array$options

◆ insert_before_or_replace()

static Wikimedia\Dodo\Internal\WhatWG::insert_before_or_replace ( Node $child,
ContainerNode $parent,
?Node $before,
bool $replace )
static
Parameters
Node$child
ContainerNode$parent
?Node$before
bool$replace

◆ is_valid_xml_chars()

static bool Wikimedia\Dodo\Internal\WhatWG::is_valid_xml_chars ( $s)
static
Parameters
string$s
Returns
bool

◆ is_valid_xml_name()

static bool Wikimedia\Dodo\Internal\WhatWG::is_valid_xml_name ( $s)
static
Parameters
string$s
Returns
bool

◆ is_valid_xml_qname()

static bool Wikimedia\Dodo\Internal\WhatWG::is_valid_xml_qname ( $s)
static
See also
https://dom.spec.whatwg.org/#validate
Parameters
string$s
Returns
bool

◆ locate_namespace()

static string Wikimedia\Dodo\Internal\WhatWG::locate_namespace ( Node $node,
?string $prefix )
static
See also
https://dom.spec.whatwg.org/#locate-a-namespace
Parameters
Node$node
?string$prefix
Returns
?string

◆ locate_prefix()

static string Wikimedia\Dodo\Internal\WhatWG::locate_prefix ( Node $node,
?string $ns )
static
See also
https://dom.spec.whatwg.org/#locate-a-namespace-prefix
Parameters
Node$node
?string$ns
Returns
?string

◆ validate_and_extract()

static void Wikimedia\Dodo\Internal\WhatWG::validate_and_extract ( ?string & $ns,
string $qname,
?string & $prefix,
?string & $lname )
static

Validate and extract a namespace and qualifiedName.

Used to map (namespace, qualifiedName) => (namespace, prefix, localName)

See also
https://dom.spec.whatwg.org/#validate-and-extract
Parameters
?string&$ns
string$qname
?string&$prefixreference (will be NULL or contain prefix string)
?string&$lnamereference (will be qname or contain lname string)
Returns
void
Exceptions
DOMException"NamespaceError"

◆ xmlSerialize()

static Wikimedia\Dodo\Internal\WhatWG::xmlSerialize ( Node $node,
array $options,
array & $markup )
static

The "XML serialization" algorithm.

See also
https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization
Parameters
Node$node
array$options
string[]&$markup

◆ xmlSerializeAttributes()

static Wikimedia\Dodo\Internal\WhatWG::xmlSerializeAttributes ( NamedNodeMap $attributes,
NamespacePrefixMap $map,
int & $prefixIndex,
array & $localPrefixesMap,
bool $ignoreNamespaceDefinitionAttribute,
array $options,
array & $markup )
static

XML serialization of the attributes of an element.

See also
https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes
Parameters
NamedNodeMap$attributes
NamespacePrefixMap$map
int&$prefixIndex
array<string,string>&$localPrefixesMap
bool$ignoreNamespaceDefinitionAttribute
array$options
string[]&$markupaccumulator for the result

◆ xmlSerializeAttrValue()

static Wikimedia\Dodo\Internal\WhatWG::xmlSerializeAttrValue ( ?string $value,
array $options,
array & $markup )
static

Serialize an attribute value (for XML).

See also
https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value
Parameters
?string$value
array$options
string[]&$markup

◆ xmlSerializeElement()

static Wikimedia\Dodo\Internal\WhatWG::xmlSerializeElement ( Element $el,
?string $namespace,
NamespacePrefixMap $prefixMap,
int & $prefixIndex,
array $options,
array & $markup )
static

XML serializing an Element node.

Moved here from Element::_xmlSerialize because it's huge!

See also
https://w3c.github.io/DOM-Parsing/#dfn-xml-serializing-an-element-node
Parameters
Element$el
?string$namespace
NamespacePrefixMap$prefixMap
int&$prefixIndex
array$options
string[]&$markupaccumulator for the result

The documentation for this class was generated from the following file: