public function matchesNode()

in src/Facebook/InstantArticles/Transformer/Rules/VideoRule.php [47:68]


    public function matchesNode($node)
    {
        $matches_node = parent::matchesNode($node);
        if ($matches_node && $this->childSelector) {
            $matches_node = false;
            if ($node->hasChildNodes()) {
                foreach ($node->childNodes as $child) {
                    $domXPath = new \DOMXPath($child->ownerDocument);
                    $converter = new CssSelectorConverter();
                    $xpath = $converter->toXPath($this->childSelector === null ? "" : $this->childSelector);
                    $results = $domXPath->query($xpath, $node);
                    foreach ($results as $result) {
                        if ($result === $child) {
                            $matches_node = true;
                        }
                    }
                }
            }
        }

        return $matches_node;
    }