Skip to content

Commit

Permalink
Implement in_table_scope
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jul 5, 2024
1 parent cff5faa commit 6ef9df9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/wp-includes/html-api/class-wp-html-open-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,19 @@ public function has_element_in_button_scope( $tag_name ) {
/**
* Returns whether a particular element is in table scope.
*
* @since 6.4.0
* @since 6.4.0 Stub implementation (throws).
* @since 6.7.0 Full implementation.
*
* @see https://html.spec.whatwg.org/#has-an-element-in-table-scope
*
* @throws WP_HTML_Unsupported_Exception Always until this function is implemented.
*
* @param string $tag_name Name of tag to check.
* @return bool Whether given element is in scope.
*/
public function has_element_in_table_scope( $tag_name ) {
throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on table scope.' );

return false; // The linter requires this unreachable code until the function is implemented and can return.
return $this->has_element_in_specific_scope(
$tag_name,
array( 'HTML', 'TABLE', 'TEMPLATE' )
);
}

/**
Expand Down

0 comments on commit 6ef9df9

Please sign in to comment.