Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder Class Reference
+ Inheritance diagram for Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder:

Public Member Functions

 __construct (Document $document, Frame $frame)
 
 findTopLevelNonOverlappingRanges (Node $docRoot, array $tplRanges)
 Identify the elements of $tplRanges that are non-overlapping.
 
 execute (Node $root)
 

Protected Member Functions

 updateDSRForFirstRangeNode (Element $target, Element $source)
 
 getRangeId (Element $node)
 Returns the range ID of a node - in the case of templates, its "about" attribute.
 
 getStartConsideringFosteredContent (Node $node)
 Returns the current node if it's not just after fostered content, the first node of fostered content otherwise.
 
 findWrappableMetaRanges (Node $rootNode)
 Recursively walk the DOM tree.
 
 matchMetaType (Element $elem)
 Returns the meta type of the element if it exists and matches the type expected by the current class, null otherwise.
 
 verifyTplInfoExpectation (?TemplateInfo $templateInfo, TempData $tmp)
 
 findEnclosingRange (Element $startElem, Element $endElem)
 Creates a range that encloses $startElem and $endElem.
 

Protected Attributes

 $env
 
 $nodeRanges
 
 $traceType
 

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::__construct ( Document $document,
Frame $frame )

Member Function Documentation

◆ findEnclosingRange()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::findEnclosingRange ( Element $startElem,
Element $endElem )
protected

Creates a range that encloses $startElem and $endElem.

Parameters
Element$startElem
Element$endElem
Returns
DOMRangeInfo

◆ findTopLevelNonOverlappingRanges()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::findTopLevelNonOverlappingRanges ( Node $docRoot,
array $tplRanges )

Identify the elements of $tplRanges that are non-overlapping.

Record template info in $this->compoundTpls as we go.

Parameters
Node$docRoot
DOMRangeInfo[]$tplRangesThe potentially overlapping ranges
Returns
DOMRangeInfo[] The non-overlapping ranges

◆ findWrappableMetaRanges()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::findWrappableMetaRanges ( Node $rootNode)
protected

Recursively walk the DOM tree.

Find wrappable template ranges and return them.

Parameters
Node$rootNode
Returns
DOMRangeInfo[]

◆ getRangeId()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::getRangeId ( Element $node)
protected

Returns the range ID of a node - in the case of templates, its "about" attribute.

Parameters
Element$node
Returns
string

Reimplemented in Wikimedia\Parsoid\Wt2Html\PP\Processors\AnnotationDOMRangeBuilder.

◆ getStartConsideringFosteredContent()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::getStartConsideringFosteredContent ( Node $node)
protected

Returns the current node if it's not just after fostered content, the first node of fostered content otherwise.

Parameters
Node$node
Returns
Node

◆ matchMetaType()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::matchMetaType ( Element $elem)
protected

Returns the meta type of the element if it exists and matches the type expected by the current class, null otherwise.

Parameters
Element$elemthe element to check
Returns
string|null

Reimplemented in Wikimedia\Parsoid\Wt2Html\PP\Processors\AnnotationDOMRangeBuilder.

◆ updateDSRForFirstRangeNode()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::updateDSRForFirstRangeNode ( Element $target,
Element $source )
protected

◆ verifyTplInfoExpectation()

Wikimedia\Parsoid\Wt2Html\PP\Processors\DOMRangeBuilder::verifyTplInfoExpectation ( ?TemplateInfo $templateInfo,
TempData $tmp )
protected

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