@@ -281,6 +281,7 @@ public function has_element_in_specific_scope( string $tag_name, $termination_li
281281 * > - th
282282 * > - marquee
283283 * > - object
284+ * > - select
284285 * > - template
285286 * > - MathML mi
286287 * > - MathML mo
@@ -312,6 +313,7 @@ public function has_element_in_scope( string $tag_name ): bool {
312313 'TH ' ,
313314 'MARQUEE ' ,
314315 'OBJECT ' ,
316+ 'SELECT ' ,
315317 'TEMPLATE ' ,
316318
317319 'math MI ' ,
@@ -362,6 +364,7 @@ public function has_element_in_list_item_scope( string $tag_name ): bool {
362364 'MARQUEE ' ,
363365 'OBJECT ' ,
364366 'OL ' ,
367+ 'SELECT ' ,
365368 'TEMPLATE ' ,
366369 'UL ' ,
367370
@@ -410,6 +413,7 @@ public function has_element_in_button_scope( string $tag_name ): bool {
410413 'TH ' ,
411414 'MARQUEE ' ,
412415 'OBJECT ' ,
416+ 'SELECT ' ,
413417 'TEMPLATE ' ,
414418
415419 'math MI ' ,
@@ -459,9 +463,8 @@ public function has_element_in_table_scope( string $tag_name ): bool {
459463 /**
460464 * Returns whether a particular element is in select scope.
461465 *
462- * This test differs from the others like it, in that its rules are inverted.
463- * Instead of arriving at a match when one of any tag in a termination group
464- * is reached, this one terminates if any other tag is reached.
466+ * The "select scope" concept was removed from the HTML standard along with the
467+ * customizable `<select>` changes, so nothing is ever in select scope.
465468 *
466469 * > The stack of open elements is said to have a particular element in select scope when it has
467470 * > that element in the specific scope consisting of all element types except the following:
@@ -471,24 +474,14 @@ public function has_element_in_table_scope( string $tag_name ): bool {
471474 * @since 6.4.0 Stub implementation (throws).
472475 * @since 6.7.0 Full implementation.
473476 *
474- * @see https://html.spec.whatwg.org/#has-an-element-in-select-scope
477+ * @deprecated 7.1.0 This method is no longer part of the HTML standard.
478+ * @ignore
475479 *
476480 * @param string $tag_name Name of tag to check.
477- * @return bool Whether the given element is in SELECT scope .
481+ * @return bool Always false; select scope no longer exists .
478482 */
479483 public function has_element_in_select_scope ( string $ tag_name ): bool {
480- foreach ( $ this ->walk_up () as $ node ) {
481- if ( $ node ->node_name === $ tag_name ) {
482- return true ;
483- }
484-
485- if (
486- 'OPTION ' !== $ node ->node_name &&
487- 'OPTGROUP ' !== $ node ->node_name
488- ) {
489- return false ;
490- }
491- }
484+ _deprecated_function ( __METHOD__ , '7.1.0 ' );
492485
493486 return false ;
494487 }
@@ -697,6 +690,7 @@ public function after_element_push( WP_HTML_Token $item ): void {
697690 case 'TH ' :
698691 case 'MARQUEE ' :
699692 case 'OBJECT ' :
693+ case 'SELECT ' :
700694 case 'TEMPLATE ' :
701695 case 'math MI ' :
702696 case 'math MO ' :
@@ -753,6 +747,7 @@ public function after_element_pop( WP_HTML_Token $item ): void {
753747 case 'TH ' :
754748 case 'MARQUEE ' :
755749 case 'OBJECT ' :
750+ case 'SELECT ' :
756751 case 'TEMPLATE ' :
757752 case 'math MI ' :
758753 case 'math MO ' :
0 commit comments