Returns whether a particular element is in select scope.
Description
This test differs from the others like it, in that its rules are inverted.
Instead of arriving at a match when one of any tag in a termination group is reached, this one terminates if any other tag is reached.
The stack of open elements is said to have a particular element in select scope when it has that element in the specific scope consisting of all element types except the following:
- optgroup in the HTML namespace
- option in the HTML namespace
See also
Parameters
$tag_namestringrequired- Name of tag to check.
Source
public function has_element_in_select_scope( string $tag_name ): bool {
foreach ( $this->walk_up() as $node ) {
if ( $node->node_name === $tag_name ) {
return true;
}
if (
'OPTION' !== $node->node_name &&
'OPTGROUP' !== $node->node_name
) {
return false;
}
}
return false;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.