Changeset 64241
- Timestamp:
- 10/08/2026 11:33:48 AM (9 days ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
src/js/_enqueues/wp/customize/controls.js (modified) (1 diff)
-
src/js/_enqueues/wp/theme.js (modified) (11 diffs)
-
src/js/media/views/frame/edit-attachments.js (modified) (3 diffs)
-
src/wp-admin/css/colors/_admin.scss (modified) (1 diff)
-
src/wp-admin/css/customize-controls.css (modified) (1 diff)
-
src/wp-admin/css/media.css (modified) (2 diffs)
-
src/wp-admin/css/themes.css (modified) (3 diffs)
-
src/wp-admin/includes/theme.php (modified) (2 diffs)
-
src/wp-admin/theme-install.php (modified) (4 diffs)
-
src/wp-admin/themes.php (modified) (4 diffs)
-
src/wp-includes/media-template.php (modified) (2 diffs)
-
tests/qunit/index.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/customize/controls.js
r63600 r64241 2598 2598 updateLimits: function () { 2599 2599 if ( ! this.getNextTheme() ) { 2600 this.overlay.find( '.right' ).addClass( 'disabled' ); 2600 this.overlay.find( '.right' ) 2601 .addClass( 'disabled' ) 2602 .attr( 'aria-disabled', true ); 2601 2603 } 2602 2604 if ( ! this.getPreviousTheme() ) { 2603 this.overlay.find( '.left' ).addClass( 'disabled' ); 2605 this.overlay.find( '.left' ) 2606 .addClass( 'disabled' ) 2607 .attr( 'aria-disabled', true ); 2604 2608 } 2605 2609 }, -
trunk/src/js/_enqueues/wp/theme.js
r63766 r64241 481 481 } 482 482 483 // S et focused theme to current element.483 // Store the theme that had focus when expand is called. 484 484 themes.focusedTheme = this.$el; 485 485 … … 521 521 event = event || window.event; 522 522 523 // S et focus to current theme.523 // Store the theme that had focus when preview is called. 524 524 themes.focusedTheme = this.$el; 525 525 … … 621 621 previousThemeButton 622 622 .addClass( 'disabled' ) 623 .prop( 'disabled', true ); 624 625 nextThemeButton.trigger( 'focus' ); 623 .attr( 'aria-disabled', true ) 624 .trigger( 'focus' ); 626 625 } 627 626 … … 630 629 nextThemeButton 631 630 .addClass( 'disabled' ) 632 .prop( 'disabled', true ); 633 634 previousThemeButton.trigger( 'focus' ); 631 .attr( 'aria-disabled', true ) 632 .trigger( 'focus' ); 635 633 } 636 634 }, … … 726 724 // Set initial focus and constrain tabbing within the theme browser modal. 727 725 containFocus: function( $el ) { 728 729 // Set initial focus on the primary action control. 730 _.delay( function() { 731 $( '.theme-overlay' ).trigger( 'focus' ); 732 }, 100 ); 726 // Set initial focus on the theme overlay modal dialog, only on first render. 727 var $themeOverlay = $( '.theme-overlay' ); 728 if ( $themeOverlay.hasClass( 'theme-overlay-initial' ) ) { 729 _.delay( function() { 730 $themeOverlay.trigger( 'focus' ).removeClass( 'theme-overlay-initial' ); 731 }, 100 ); 732 } 733 733 734 734 735 // Constrain tabbing within the modal. … … 786 787 document.body.scrollTop = scroll; 787 788 788 // Return focus to the theme div.789 // Return focus to the opener theme 'more-details' button. 789 790 if ( themes.focusedTheme ) { 790 themes.focusedTheme.find( '.more-details').trigger( 'focus' );791 themes.focusedTheme.find( '.more-details' ).trigger( 'focus' ); 791 792 } 793 794 // Add back the `theme-overlay-initial` class for the theme overlay. 795 $( '.theme-overlay' ).addClass( 'theme-overlay-initial' ); 792 796 }); 793 797 } … … 804 808 this.$el.find( '.left' ) 805 809 .addClass( 'disabled' ) 806 . prop( 'disabled', true );810 .attr( 'aria-disabled', true ); 807 811 } 808 812 if ( this.model.cid === this.model.collection.at( this.model.collection.length - 1 ).cid ) { 809 813 this.$el.find( '.right' ) 810 814 .addClass( 'disabled' ) 811 . prop( 'disabled', true );815 .attr( 'aria-disabled', true ); 812 816 } 813 817 }, … … 961 965 this.$el.fadeIn( 200, function() { 962 966 $body.addClass( 'theme-installer-active full-overlay-active' ); 967 // Set initial focus on the theme installer overlay modal dialog. 968 self.$el.trigger( 'focus' ); 963 969 }); 964 970 … … 977 983 $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' ); 978 984 979 // Return focus to the theme div.985 // Return focus to the opener theme 'more-details' button. 980 986 if ( themes.focusedTheme ) { 981 themes.focusedTheme.find( '.more-details').trigger( 'focus' );987 themes.focusedTheme.find( '.more-details' ).trigger( 'focus' ); 982 988 } 983 989 }).removeClass( 'iframe-ready' ); … … 1355 1361 // Trigger a route update for the current model. 1356 1362 self.theme.trigger( 'theme:expand', nextModel.cid ); 1363 // Set focus again to the 'Next' navigation button after the view fully re-rendeers. 1364 $( '.theme-header .right' ).trigger( 'focus' ); 1357 1365 themes.announceThemeDebounced( nextModel ); 1358 1366 } … … 1390 1398 // Trigger a route update for the current model. 1391 1399 self.theme.trigger( 'theme:expand', previousModel.cid ); 1400 // Set focus again to the 'Previous' navigation button after the view fully re-rendeers. 1401 $( '.theme-header .left' ).trigger( 'focus' ); 1392 1402 themes.announceThemeDebounced( previousModel ); 1393 1403 } -
trunk/src/js/media/views/frame/edit-attachments.js
r63409 r64241 202 202 203 203 toggleNav: function() { 204 this.$( '.left' ). prop( 'disabled', ! this.hasPrevious() );205 this.$( '.right' ). prop( 'disabled', ! this.hasNext() );204 this.$( '.left' ).attr( 'aria-disabled', ! this.hasPrevious() ); 205 this.$( '.right' ).attr( 'aria-disabled', ! this.hasNext() ); 206 206 }, 207 207 … … 239 239 model = this.library.at( this.getCurrentIndex() - 1 ); 240 240 this.trigger( 'refresh', model ); 241 // Move focus to the Previous button. When there are no more items, to the Next button.242 this.focusNavButton( this.hasPrevious() ? '.left' : '.right' );243 241 this.announceMediaItemDebounced( model ); 244 242 }, … … 256 254 model = this.library.at( this.getCurrentIndex() + 1 ); 257 255 this.trigger( 'refresh', model ); 258 // Move focus to the Next button. When there are no more items, to the Previous button.259 this.focusNavButton( this.hasNext() ? '.right' : '.left' );260 256 this.announceMediaItemDebounced( model ); 261 },262 263 /**264 * Set focus to the navigation buttons depending on the browsing direction.265 *266 * @since 5.3.0267 *268 * @param {string} which A CSS selector to target the button to focus.269 */270 focusNavButton: function( which ) {271 $( which ).trigger( 'focus' );272 257 }, 273 258 -
trunk/src/wp-admin/css/colors/_admin.scss
r63996 r64241 774 774 &.wp-customizer .theme-overlay .theme-header .close:focus, 775 775 &.wp-customizer .theme-overlay .theme-header .close:hover, 776 &.wp-customizer .theme-overlay .theme-header .right:focus ,777 &.wp-customizer .theme-overlay .theme-header .right:hover ,778 &.wp-customizer .theme-overlay .theme-header .left:focus ,779 &.wp-customizer .theme-overlay .theme-header .left:hover {776 &.wp-customizer .theme-overlay .theme-header .right:focus:not(.disabled), 777 &.wp-customizer .theme-overlay .theme-header .right:hover:not(.disabled), 778 &.wp-customizer .theme-overlay .theme-header .left:focus:not(.disabled), 779 &.wp-customizer .theme-overlay .theme-header .left:hover:not(.disabled) { 780 780 border-bottom-color: variables.$button-color; 781 781 color: variables.$link; -
trunk/src/wp-admin/css/customize-controls.css
r64229 r64241 2456 2456 .wp-customizer .theme-overlay .theme-header .close:focus, 2457 2457 .wp-customizer .theme-overlay .theme-header .close:hover, 2458 .wp-customizer .theme-overlay .theme-header .right:focus ,2459 .wp-customizer .theme-overlay .theme-header .right:hover ,2460 .wp-customizer .theme-overlay .theme-header .left:focus ,2461 .wp-customizer .theme-overlay .theme-header .left:hover {2458 .wp-customizer .theme-overlay .theme-header .right:focus:not(.disabled), 2459 .wp-customizer .theme-overlay .theme-header .right:hover:not(.disabled), 2460 .wp-customizer .theme-overlay .theme-header .left:focus:not(.disabled), 2461 .wp-customizer .theme-overlay .theme-header .left:hover:not(.disabled) { 2462 2462 background: #fff; 2463 2463 } -
trunk/src/wp-admin/css/media.css
r63987 r64241 726 726 .edit-attachment-frame .edit-media-header .left:focus, 727 727 .edit-attachment-frame .edit-media-header .right:focus { 728 /* Only visiblein Windows High Contrast mode */729 outline: 2px solid transparent;730 outline-offset: - 2px;728 /* Always visible also in Windows High Contrast mode */ 729 outline: 1px solid #c3c4c7;; 730 outline-offset: -1px; 731 731 } 732 732 … … 746 746 } 747 747 748 .edit-attachment-frame .edit-media-header [disabled], 749 .edit-attachment-frame .edit-media-header [disabled]:hover { 748 .edit-attachment-frame .edit-media-header [aria-disabled="true"], 749 .edit-attachment-frame .edit-media-header [aria-disabled="true"]:hover, 750 .edit-attachment-frame .edit-media-header [aria-disabled="true"]:focus { 750 751 color: #c3c4c7; 751 752 background: inherit; -
trunk/src/wp-admin/css/themes.css
r63998 r64241 1407 1407 } 1408 1408 1409 /* Make sure the ARIA live regions are visible, as they inherit the hidden visibility from the body. */ 1410 .a11y-speak-intro-text, 1411 .a11y-speak-region { 1412 visibility: visible; 1413 } 1414 1409 1415 .wp-full-overlay { 1410 1416 background: #1d2327; … … 1562 1568 } 1563 1569 1570 .theme-install-overlay .close-full-overlay:focus, 1571 .theme-install-overlay .previous-theme:focus, 1572 .theme-install-overlay .next-theme:focus { 1573 /* Always visible also in Windows High Contrast mode */ 1574 outline: 1px solid #c3c4c7;; 1575 outline-offset: -1px; 1576 } 1577 1564 1578 .theme-install-overlay .close-full-overlay::before { 1565 1579 font: 400 22px/1 dashicons; … … 1598 1612 background: #f0f0f1; 1599 1613 cursor: default; 1600 pointer-events: none;1601 1614 } 1602 1615 -
trunk/src/wp-admin/includes/theme.php
r63494 r64241 829 829 <?php 830 830 /* translators: Hidden accessibility text. */ 831 _e ( 'Show previoustheme' );831 _ex( 'Previous', 'theme' ); 832 832 ?> 833 833 </span></button> … … 835 835 <?php 836 836 /* translators: Hidden accessibility text. */ 837 _e ( 'Show nexttheme' );837 _ex( 'Next', 'theme' ); 838 838 ?> 839 839 </span></button> -
trunk/src/wp-admin/theme-install.php
r62878 r64241 282 282 </h2> 283 283 <div class="theme-browser content-filterable"></div> 284 <div class="theme-install-overlay wp-full-overlay expanded" ></div>284 <div class="theme-install-overlay wp-full-overlay expanded" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Browse Themes' ); ?>"></div> 285 285 286 286 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> … … 391 391 <# } #> 392 392 393 <# if ( data.compatible_wp && data.compatible_php ) { #> 394 <button type="button" class="more-details"><?php _ex( 'Details & Preview', 'theme' ); ?></button> 395 <# } else { #> 393 396 <span class="more-details"><?php _ex( 'Details & Preview', 'theme' ); ?></span> 397 <# } #> 394 398 <div class="theme-author"> 395 399 <?php … … 474 478 <?php 475 479 /* translators: Hidden accessibility text. */ 476 _e ( 'Previoustheme' );480 _ex( 'Previous', 'theme' ); 477 481 ?> 478 482 </span></button> … … 480 484 <?php 481 485 /* translators: Hidden accessibility text. */ 482 _e ( 'Nexttheme' );486 _ex( 'Next', 'theme' ); 483 487 ?> 484 488 </span></button> -
trunk/src/wp-admin/themes.php
r62878 r64241 665 665 </div> 666 666 </div> 667 <div class="theme-overlay " tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>667 <div class="theme-overlay theme-overlay-initial" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div> 668 668 669 669 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> … … 1058 1058 <?php 1059 1059 /* translators: Hidden accessibility text. */ 1060 _e ( 'Show previoustheme' );1060 _ex( 'Previous', 'theme' ); 1061 1061 ?> 1062 1062 </span></button> … … 1064 1064 <?php 1065 1065 /* translators: Hidden accessibility text. */ 1066 _e ( 'Show nexttheme' );1066 _ex( 'Next', 'theme' ); 1067 1067 ?> 1068 1068 </span></button> … … 1070 1070 <?php 1071 1071 /* translators: Hidden accessibility text. */ 1072 _e( 'Close details dialog' );1072 _e( 'Close' ); 1073 1073 ?> 1074 1074 </span></button> -
trunk/src/wp-includes/media-template.php
r63612 r64241 207 207 <?php 208 208 /* translators: Hidden accessibility text. */ 209 _e( 'Close dialog' );209 _e( 'Close' ); 210 210 ?> 211 211 </span></button> … … 370 370 <script type="text/html" id="tmpl-edit-attachment-frame"> 371 371 <div class="edit-media-header"> 372 <button class="left dashicons"<# if ( ! data.hasPrevious ) { #> disabled<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Edit previousmedia item' ); ?></span></button>373 <button class="right dashicons"<# if ( ! data.hasNext ) { #> disabled<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Edit nextmedia item' ); ?></span></button>374 <button type="button" class="media-modal-close"><span class="media-modal-icon" aria-hidden="true"></span><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></button>372 <button class="left dashicons"<# if ( ! data.hasPrevious ) { #> aria-disabled='true'<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _ex( 'Previous', 'media item' ); ?></span></button> 373 <button class="right dashicons"<# if ( ! data.hasNext ) { #> aria-disabled='true'<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _ex( 'Next', 'media item' ); ?></span></button> 374 <button type="button" class="media-modal-close"><span class="media-modal-icon" aria-hidden="true"></span><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button> 375 375 </div> 376 376 <div class="media-frame-title"></div> -
trunk/tests/qunit/index.html
r63336 r64241 1002 1002 <script type="text/html" id="tmpl-media-modal"> 1003 1003 <div class="media-modal wp-core-ui"> 1004 <button type="button" class="media-modal-close"><span class="media-modal-icon" aria-hidden="true"></span><span class="screen-reader-text">Close media panel</span></button>1004 <button type="button" class="media-modal-close"><span class="media-modal-icon" aria-hidden="true"></span><span class="screen-reader-text">Close</span></button> 1005 1005 <div class="media-modal-content"></div> 1006 1006 </div> … … 1082 1082 <script type="text/html" id="tmpl-edit-attachment-frame"> 1083 1083 <div class="edit-media-header"> 1084 <button class="left dashicons <# if ( ! data.hasPrevious ) { #> disabled <# } #>"><span class="screen-reader-text"> Edit previous media item</span></button>1085 <button class="right dashicons <# if ( ! data.hasNext ) { #> disabled <# } #>"><span class="screen-reader-text"> Edit next media item</span></button>1084 <button class="left dashicons <# if ( ! data.hasPrevious ) { #> disabled <# } #>"><span class="screen-reader-text">Previous</span></button> 1085 <button class="right dashicons <# if ( ! data.hasNext ) { #> disabled <# } #>"><span class="screen-reader-text">Next</span></button> 1086 1086 </div> 1087 1087 <div class="media-frame-title"></div>
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)