Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DOMTreeBuilder.php

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\Parser

Code

protected function isAncestor($tagName) {
    $candidate = $this->current;
    while (XML_ELEMENT_NODE === $candidate->nodeType) {
        if ($candidate->tagName === $tagName) {
            return true;
        }
        $candidate = $candidate->parentNode;
    }
    return false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal