Debian Codegraph @

vendor/wikimedia/parsoid/src/Wt2Html/DOM/Processors/DOMRangeInfo.php

raw
1 <?php
2 declare( strict_types = 1 );
3
4 namespace Wikimedia\Parsoid\Wt2Html\DOM\Processors;
5
6 use Wikimedia\Parsoid\DOM\Element;
7 use Wikimedia\Parsoid\DOM\Node;
8
9 class DOMRangeInfo {
10 public string $id;
11 public int $startOffset;
12
13 /**
14 * $startElem, $endElem are the start/end meta tags for a transclusion
15 * $start, $end are the start/end DOM nodes after the range is
16 * expanded, merged with other ranges, etc. In the simple cases, they will
17 * be identical to $startElem, $endElem.
18 */
19 public Element $startElem;
20 public Element $endElem;
21 public ?Node $start;
22 public ?Node $end;
23
24 /**
25 * In foster-parenting situations, the end-meta tag can show up before the
26 * start-meta. We record this info for later analysis.
27 */
28 public bool $flipped = false;
29
30 /**
31 * A range is marked as extended when it is found to overlap with another
32 * range during findTopLevelNonOverlappingRanges.
33 */
34 public bool $extendedByOverlapMerge = false;
35
36 public function __construct(
37 string $id, int $startOffset, Element $startMeta, Element $endMeta
38 ) {
39 $this->id = $id;
40 $this->startOffset = $startOffset;
41 $this->startElem = $startMeta;
42 $this->endElem = $endMeta;
43 }
44 }