- Timestamp:
- 01/10/2024 02:03:57 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-open-elements.php
r57186 r57264 130 130 131 131 if ( in_array( $node->node_name, $termination_list, true ) ) { 132 return true;132 return false; 133 133 } 134 134 } … … 167 167 * 168 168 * @since 6.4.0 169 * @since 6.5.0 Implemented: no longer throws on every invocation. 169 170 * 170 171 * @see https://html.spec.whatwg.org/#has-an-element-in-list-item-scope 171 *172 * @throws WP_HTML_Unsupported_Exception Always until this function is implemented.173 172 * 174 173 * @param string $tag_name Name of tag to check. … … 176 175 */ 177 176 public function has_element_in_list_item_scope( $tag_name ) { 178 throw new WP_HTML_Unsupported_Exception( 'Cannot process elements depending on list item scope.' ); 179 180 return false; // The linter requires this unreachable code until the function is implemented and can return. 177 return $this->has_element_in_specific_scope( 178 $tag_name, 179 array( 180 // There are more elements that belong here which aren't currently supported. 181 'OL', 182 'UL', 183 ) 184 ); 181 185 } 182 186 … … 376 380 * 377 381 * @since 6.4.0 378 */ 379 public function walk_up() { 382 * @since 6.5.0 Accepts $above_this_node to start traversal above a given node, if it exists. 383 * 384 * @param ?WP_HTML_Token $above_this_node Start traversing above this node, if provided and if the node exists. 385 */ 386 public function walk_up( $above_this_node = null ) { 387 $has_found_node = null === $above_this_node; 388 380 389 for ( $i = count( $this->stack ) - 1; $i >= 0; $i-- ) { 381 yield $this->stack[ $i ]; 390 $node = $this->stack[ $i ]; 391 392 if ( ! $has_found_node ) { 393 $has_found_node = $node === $above_this_node; 394 continue; 395 } 396 397 yield $node; 382 398 } 383 399 }
Note: See TracChangeset
for help on using the changeset viewer.