From 6ef9df9b7c61e1e4ddc52d0dfe8fb40dd1c90f7f Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 4 Jul 2024 16:04:22 +0200 Subject: [PATCH] Implement in_table_scope --- .../html-api/class-wp-html-open-elements.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/html-api/class-wp-html-open-elements.php b/src/wp-includes/html-api/class-wp-html-open-elements.php index d1585cdea5bf5..c9053f7e885bb 100644 --- a/src/wp-includes/html-api/class-wp-html-open-elements.php +++ b/src/wp-includes/html-api/class-wp-html-open-elements.php @@ -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' ) + ); } /**