tagName) !== 'h1') { return null; } $doc = $element->ownerDocument; if ($doc) { $h1s = $doc->getElementsByTagName('h1'); if ($h1s->length > 1 && $h1s->item(0) !== $element) { return $this->createViolation( $element, $this->getDescription(), 'Change this heading to an h2 or lower level heading, keeping only one h1 per page.' ); } } return null; } }