Changeset 64598
- Timestamp:
- 10/20/2026 12:27:21 PM (12 hours ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/class-wp-theme-json.php (modified) (2 diffs)
-
tests/phpunit/tests/theme/wpThemeJson.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r64597 r64598 672 672 * @since 7.2.0 Added ':required', ':user-valid', ':user-invalid', ':focus', ':focus-visible', 673 673 * and '::placeholder' support for the text input element. 674 * @since 7.2.0 Added ':hover', ':focus', ':focus-visible', and ':active' support for the select element. 674 675 * @var array 675 676 */ … … 678 679 'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ), 679 680 'textInput' => array( ':required', ':user-valid', ':user-invalid', ':focus', ':focus-visible', '::placeholder' ), 681 'select' => array( ':hover', ':focus', ':focus-visible', ':active' ), 680 682 ); 681 683 -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r64597 r64598 2617 2617 2618 2618 $expected = 'h4{background-color: red;color: green;}'; 2619 2620 $this->assertSame( $expected, $theme_json->get_stylesheet( array( 'styles' ), null, array( 'skip_root_layout_styles' => true ) ) ); 2621 } 2622 2623 /** 2624 * @ticket 66349 2625 */ 2626 public function test_get_stylesheet_handles_select_pseudo_selectors() { 2627 $theme_json = new WP_Theme_JSON( 2628 array( 2629 'version' => WP_Theme_JSON::LATEST_SCHEMA, 2630 'styles' => array( 2631 'elements' => array( 2632 'select' => array( 2633 'color' => array( 2634 'text' => 'green', 2635 ), 2636 ':hover' => array( 2637 'color' => array( 2638 'background' => 'blue', 2639 ), 2640 ), 2641 ':focus' => array( 2642 'outline' => array( 2643 'style' => 'dotted', 2644 ), 2645 ), 2646 ':focus-visible' => array( 2647 'outline' => array( 2648 'style' => 'solid', 2649 ), 2650 ), 2651 ':active' => array( 2652 'color' => array( 2653 'background' => 'yellow', 2654 ), 2655 ), 2656 ':visited' => array( 2657 'color' => array( 2658 'text' => 'red', 2659 ), 2660 ), 2661 ), 2662 ), 2663 ), 2664 ) 2665 ); 2666 2667 $expected = 'select{color: green;}:root :where(select:hover){background-color: blue;}:root :where(select:focus){outline-style: dotted;}:root :where(select:focus-visible){outline-style: solid;}:root :where(select:active){background-color: yellow;}'; 2668 2669 $this->assertSame( $expected, $theme_json->get_stylesheet( array( 'styles' ), null, array( 'skip_root_layout_styles' => true ) ) ); 2670 } 2671 2672 /** 2673 * @ticket 66349 2674 */ 2675 public function test_get_stylesheet_handles_block_level_select_pseudo_selectors() { 2676 $theme_json = new WP_Theme_JSON( 2677 array( 2678 'version' => WP_Theme_JSON::LATEST_SCHEMA, 2679 'styles' => array( 2680 'blocks' => array( 2681 'core/categories' => array( 2682 'elements' => array( 2683 'select' => array( 2684 'color' => array( 2685 'text' => 'green', 2686 ), 2687 ':hover' => array( 2688 'color' => array( 2689 'background' => 'blue', 2690 ), 2691 ), 2692 ), 2693 ), 2694 ), 2695 ), 2696 ), 2697 ) 2698 ); 2699 2700 $expected = ':root :where(.wp-block-categories select){color: green;}:root :where(.wp-block-categories select:hover){background-color: blue;}'; 2619 2701 2620 2702 $this->assertSame( $expected, $theme_json->get_stylesheet( array( 'styles' ), null, array( 'skip_root_layout_styles' => true ) ) );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)