src/Range.php
/**
     * Returns true if the entire Node is within the Range, otherwise false.
     *
     * @see https://dom.spec.whatwg.org/#contained
     */
Returns true if the entire Node is within the Range, otherwise false.
Returns true if the entire Node is within the Range otherwise false .
private function isFullyContainedNode(Node $node): bool
    {
        $startBP = array($this->startNode, $this->startOffset);
        $endBP = array($this->endNode, $this->endOffset);
        $root = $this->startNode->getRootNode();
        return $node->getRootNode() === $root
            && $this->computePosition([$node, 0], $startBP) === 'after'
            && $this->computePosition([$node, $node->getLength()], $endBP) === 'before';
    }
private function isFullyContainedNode ( Node $ node ) : bool { $ startBP = array ( $ this -> startNode , $ this -> startOffset ) ; $ endBP = array ( $ this -> endNode , $ this -> endOffset ) ; $ root = $ this -> startNode -> getRootNode ( ) ; return $ node -> getRootNode ( ) === $ root && $ this -> computePosition ( [ $ node , 0 ] , $ startBP ) === 'after' && $ this -> computePosition ( [ $ node , $ node -> getLength ( ) ] , $ endBP ) === 'before' ; }
Returns true if the entire Node is within the Range, otherwise false.
Returns true if the entire Node is within the Range otherwise false .