function DOMTreeBuilder::isAncestor
Checks if the given tagname is an ancestor of the present candidate.
If $this->current or anything above $this->current matches the given tag name, this returns true.
Parameters
string $tagName:
Return value
bool
File
-
vendor/
masterminds/ html5/ src/ HTML5/ Parser/ DOMTreeBuilder.php, line 691
Class
- DOMTreeBuilder
- Create an HTML5 DOM tree from events.
Namespace
Masterminds\HTML5\ParserCode
protected function isAncestor($tagName) {
$candidate = $this->current;
while (XML_ELEMENT_NODE === $candidate->nodeType) {
if ($candidate->tagName === $tagName) {
return true;
}
$candidate = $candidate->parentNode;
}
return false;
}