<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[57708] trunk: Toolbar: Accessibility: Keyboard navigation for screen readers.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/57708">57708</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/57708","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>joedolson</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-02-26 00:50:22 +0000 (Mon, 26 Feb 2024)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Toolbar: Accessibility: Keyboard navigation for screen readers.
Change the admin toolbar to have `role="menu"` and support opening for screen readers. Remove screen reader only log out link and collapse duplicate profile links into one link. This is an imperfect solution to a complex problem in the adminbar, but the lack of screen reader access to submenus is a major accessibility problem, and this fix provides access, even if the mechanism is imperfect.
Screen reader log out added in <a href="https://core.trac.wordpress.org/changeset/21452">[21452]</a>.
Props abletec, Cheffheid, sabernhardt, alexstine, joedolson, afercia, sparklingrobots, danieltj, swissspidy, netweb, dionysous.
Fixes <a href="https://core.trac.wordpress.org/ticket/34668">#34668</a>, <a href="https://core.trac.wordpress.org/ticket/43633">#43633</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcjs_enqueueslibadminbarjs">trunk/src/js/_enqueues/lib/admin-bar.js</a></li>
<li><a href="#trunksrcwpincludesadminbarphp">trunk/src/wp-includes/admin-bar.php</a></li>
<li><a href="#trunksrcwpincludesclasswpadminbarphp">trunk/src/wp-includes/class-wp-admin-bar.php</a></li>
<li><a href="#trunksrcwpincludescssadminbarcss">trunk/src/wp-includes/css/admin-bar.css</a></li>
<li><a href="#trunktestsphpunittestsadminbarphp">trunk/tests/phpunit/tests/adminbar.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcjs_enqueueslibadminbarjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/lib/admin-bar.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/lib/admin-bar.js 2024-02-25 22:15:11 UTC (rev 57707)
+++ trunk/src/js/_enqueues/lib/admin-bar.js 2024-02-26 00:50:22 UTC (rev 57708)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> topMenuItems = adminBar.querySelectorAll( 'li.menupop' );
</span><span class="cx" style="display: block; padding: 0 10px"> allMenuItems = adminBar.querySelectorAll( '.ab-item' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- adminBarLogout = document.getElementById( 'wp-admin-bar-logout' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ adminBarLogout = document.querySelector( '#wp-admin-bar-logout a' );
</ins><span class="cx" style="display: block; padding: 0 10px"> adminBarSearchForm = document.getElementById( 'adminbarsearch' );
</span><span class="cx" style="display: block; padding: 0 10px"> shortlink = document.getElementById( 'wp-admin-bar-get-shortlink' );
</span><span class="cx" style="display: block; padding: 0 10px"> skipLink = adminBar.querySelector( '.screen-reader-shortcut' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,7 +149,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function toggleHoverIfEnter( event ) {
</span><span class="cx" style="display: block; padding: 0 10px"> var wrapper;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( event.which !== 13 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Follow link if pressing Ctrl and/or Shift with Enter (opening in a new tab or window).
+ if ( event.which !== 13 || event.ctrlKey || event.shiftKey ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,6 +337,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> element.className += className;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var menuItemToggle = element.querySelector( 'a' );
+ if ( className === 'hover' && menuItemToggle && menuItemToggle.hasAttribute( 'aria-expanded' ) ) {
+ menuItemToggle.setAttribute( 'aria-expanded', 'true' );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -366,6 +372,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> element.className = classes.replace( /^[\s]+|[\s]+$/g, '' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var menuItemToggle = element.querySelector( 'a' );
+ if ( className === 'hover' && menuItemToggle && menuItemToggle.hasAttribute( 'aria-expanded' ) ) {
+ menuItemToggle.setAttribute( 'aria-expanded', 'false' );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesadminbarphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/admin-bar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/admin-bar.php 2024-02-25 22:15:11 UTC (rev 57707)
+++ trunk/src/wp-includes/admin-bar.php 2024-02-26 00:50:22 UTC (rev 57708)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,6 +139,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'About WordPress' ) .
</span><span class="cx" style="display: block; padding: 0 10px"> '</span>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'href' => $about_url,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'meta' => array(
+ 'menu_title' => __( 'About WordPress' ),
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Set tabindex="0" to make sub menus accessible when no URL is available.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -282,7 +285,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => $howdy . $avatar,
</span><span class="cx" style="display: block; padding: 0 10px"> 'href' => $profile_url,
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'class' => $class,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'class' => $class,
+ 'menu_title' => sprintf( __( 'Howdy, %s' ), $current_user->display_name ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -325,6 +329,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_info .= "<span class='username'>{$current_user->user_login}</span>";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $user_info .= "<span class='edit-profile'>" . __( 'Edit Profile' ) . '</span>';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar->add_node(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => 'user-actions',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -331,23 +337,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'user-info',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => $user_info,
</span><span class="cx" style="display: block; padding: 0 10px"> 'href' => $profile_url,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'meta' => array(
- 'tabindex' => -1,
- ),
</del><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( false !== $profile_url ) {
- $wp_admin_bar->add_node(
- array(
- 'parent' => 'user-actions',
- 'id' => 'edit-profile',
- 'title' => __( 'Edit Profile' ),
- 'href' => $profile_url,
- )
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar->add_node(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent' => 'user-actions',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -397,6 +389,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'site-name',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => $title,
</span><span class="cx" style="display: block; padding: 0 10px"> 'href' => ( is_admin() || ! current_user_can( 'read' ) ) ? home_url( '/' ) : admin_url(),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'meta' => array(
+ 'menu_title' => $title,
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -994,6 +989,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'new-content',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => $title,
</span><span class="cx" style="display: block; padding: 0 10px"> 'href' => admin_url( current( array_keys( $actions ) ) ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'meta' => array(
+ 'menu_title' => _x( 'New', 'admin bar menu group label' ),
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpadminbarphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-admin-bar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-admin-bar.php 2024-02-25 22:15:11 UTC (rev 57707)
+++ trunk/src/wp-includes/class-wp-admin-bar.php 2024-02-26 00:50:22 UTC (rev 57708)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,6 +107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.5.0 Added the ability to pass 'lang' and 'dir' meta data.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.5.0 Added the ability to pass 'menu_title' for an ARIA menu name.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Arguments for adding a node.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +118,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $href Optional. Link for the item.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type bool $group Optional. Whether or not the node is a group. Default false.
</span><span class="cx" style="display: block; padding: 0 10px"> * @type array $meta Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 'onclick', 'target', 'title', 'tabindex'. Default empty.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * 'onclick', 'target', 'title', 'tabindex', 'menu_title'. Default empty.
</ins><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function add_node( $args ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -478,9 +479,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( is_user_logged_in() ) : ?>
- <a class="screen-reader-shortcut" href="<?php echo esc_url( wp_logout_url() ); ?>"><?php _e( 'Log Out' ); ?></a>
- <?php endif; ?>
</del><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,10 +503,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.5.0 Added `$menu_title` parameter to allow an ARIA menu name.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param object $node
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|bool $menu_title The accessible name of this aria menu or false if not provided.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- final protected function _render_group( $node ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ final protected function _render_group( $node, $menu_title = false ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'container' === $node->type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_render_container( $node );
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -523,7 +523,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $class = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<ul id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$class>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $menu_title ) ) {
+ echo "<ul role='menu' id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$class>";
+ } else {
+ echo "<ul role='menu' aria-label='" . esc_attr( $menu_title ) . "' id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$class>";
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $node->children as $item ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_render_item( $item );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -546,8 +550,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $is_top_secondary_item = 'top-secondary' === $node->parent;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Allow only numeric values, then casted to integers, and allow a tabindex value of `0` for a11y.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tabindex = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : '';
- $aria_attributes = ( '' !== $tabindex ) ? ' tabindex="' . $tabindex . '"' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tabindex = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : '';
+ $aria_attributes = ( '' !== $tabindex ) ? ' tabindex="' . $tabindex . '"' : '';
+ $aria_attributes .= ' role="menuitem"';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $menuclass = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $arrow = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -554,7 +559,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $is_parent ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $menuclass = 'menupop ';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $aria_attributes .= ' aria-haspopup="true"';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $aria_attributes .= ' aria-expanded="false"';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $node->meta['class'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -603,7 +608,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $is_parent ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<div class="ab-sub-wrapper">';
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $node->children as $group ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->_render_group( $group );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $node->meta['menu_title'] ) ) {
+ $this->_render_group( $group, false );
+ } else {
+ $this->_render_group( $group, $node->meta['menu_title'] );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</div>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludescssadminbarcss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/css/admin-bar.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/css/admin-bar.css 2024-02-25 22:15:11 UTC (rev 57707)
+++ trunk/src/wp-includes/css/admin-bar.css 2024-02-26 00:50:22 UTC (rev 57708)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -447,6 +447,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> background: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#wpadminbar #wp-admin-bar-user-info a {
+ display: grid;
+ row-gap: 12px;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> #wp-admin-bar-user-info .avatar {
</span><span class="cx" style="display: block; padding: 0 10px"> position: absolute;
</span><span class="cx" style="display: block; padding: 0 10px"> left: -72px;
</span></span></pre></div>
<a id="trunktestsphpunittestsadminbarphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/adminbar.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/adminbar.php 2024-02-25 22:15:11 UTC (rev 57707)
+++ trunk/tests/phpunit/tests/adminbar.php 2024-02-26 00:50:22 UTC (rev 57708)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +97,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $node_site_name = $wp_admin_bar->get_node( 'site-name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $node_my_account = $wp_admin_bar->get_node( 'my-account' );
</span><span class="cx" style="display: block; padding: 0 10px"> $node_user_info = $wp_admin_bar->get_node( 'user-info' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site menu points to the home page instead of the admin URL.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( home_url( '/' ), $node_site_name->href );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,7 +104,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // No profile links as the user doesn't have any permissions on the site.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $node_my_account->href );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $node_user_info->href );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNull( $node_edit_profile );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -119,10 +117,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_admin_bar = $this->get_standard_admin_bar();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $node_site_name = $wp_admin_bar->get_node( 'site-name' );
- $node_my_account = $wp_admin_bar->get_node( 'my-account' );
- $node_user_info = $wp_admin_bar->get_node( 'user-info' );
- $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $node_site_name = $wp_admin_bar->get_node( 'site-name' );
+ $node_my_account = $wp_admin_bar->get_node( 'my-account' );
+ $node_user_info = $wp_admin_bar->get_node( 'user-info' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Site menu points to the admin URL.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( admin_url( '/' ), $node_site_name->href );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +129,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Profile URLs point to profile.php.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $profile_url, $node_my_account->href );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $profile_url, $node_user_info->href );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( $profile_url, $node_edit_profile->href );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,7 +158,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $node_site_name = $wp_admin_bar->get_node( 'site-name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $node_my_account = $wp_admin_bar->get_node( 'my-account' );
</span><span class="cx" style="display: block; padding: 0 10px"> $node_user_info = $wp_admin_bar->get_node( 'user-info' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get primary blog.
</span><span class="cx" style="display: block; padding: 0 10px"> $primary = get_active_blog_for_user( self::$editor_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -179,7 +174,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Profile URLs should go to the user's primary blog.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $primary_profile_url, $node_my_account->href );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $primary_profile_url, $node_user_info->href );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( $primary_profile_url, $node_edit_profile->href );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -218,7 +212,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $node_site_name = $wp_admin_bar->get_node( 'site-name' );
</span><span class="cx" style="display: block; padding: 0 10px"> $node_my_account = $wp_admin_bar->get_node( 'my-account' );
</span><span class="cx" style="display: block; padding: 0 10px"> $node_user_info = $wp_admin_bar->get_node( 'user-info' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $node_edit_profile = $wp_admin_bar->get_node( 'edit-profile' );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get primary blog.
</span><span class="cx" style="display: block; padding: 0 10px"> $primary = get_active_blog_for_user( self::$no_role_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,7 +227,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Profile URLs should go to the user's primary blog.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $user_profile_url, $node_my_account->href );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $user_profile_url, $node_user_info->href );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( $user_profile_url, $node_edit_profile->href );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,7 +276,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Empty string.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,7 +284,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array( 'tabindex' => '' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Integer 1 as string.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,7 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array( 'tabindex' => '1' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item" tabindex="1">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" tabindex="1" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Integer -1 as string.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -308,7 +300,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array( 'tabindex' => '-1' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item" tabindex="-1">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" tabindex="-1" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Integer 0 as string.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -316,7 +308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array( 'tabindex' => '0' ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item" tabindex="0">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" tabindex="0" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Integer, 0.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,7 +316,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array( 'tabindex' => 0 ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item" tabindex="0">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" tabindex="0" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Integer, 2.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -332,7 +324,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array( 'tabindex' => 2 ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item" tabindex="2">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" tabindex="2" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Boolean, false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -340,7 +332,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'id' => 'test-node',
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta' => array( 'tabindex' => false ),
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="ab-item ab-empty-item">',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<div class="ab-item ab-empty-item" role="menuitem">',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>
</body>
</html>