src/Range.php
/**
     * Selects the given Node and its contents.
     *
     * @see https://dom.spec.whatwg.org/#concept-range-select
     *
     * @throws \Rowbot\DOM\Exception\InvalidNodeTypeError
     */
Selects the given Node and its contents.


Selects the given Node and its contents .
public function selectNode(Node $node): void
    {
        $parent = $node->parentNode;
        if (!$parent) {
            throw new InvalidNodeTypeError();
        }
        $index = $node->getTreeIndex();
        $this->startNode = $parent;
        $this->startOffset = $index;
        $this->endNode = $parent;
        $this->endOffset = $index + 1;
    }
public function selectNode ( Node $ node ) : void { $ parent = $ node -> parentNode ; if ( ! $ parent ) { throw new InvalidNodeTypeError ( ) ; } $ index = $ node -> getTreeIndex ( ) ; $ this -> startNode = $ parent ; $ this -> startOffset = $ index ; $ this -> endNode = $ parent ; $ this -> endOffset = $ index + 1 ; }
Selects the given Node and its contents.
Selects the given Node and its contents .