Improve accessibility on webkit.org
authorjond@apple.com <jond@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jun 2019 17:03:27 +0000 (17:03 +0000)
committerjond@apple.com <jond@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jun 2019 17:03:27 +0000 (17:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198531

Reviewed by Devin Rousso.

* wp-content/themes/webkit/functions.php: Added menuitem ARIA role to links
* wp-content/themes/webkit/widgets/post.php: Added aria-label to SVG icons

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/webkit.org/ChangeLog
Websites/webkit.org/wp-content/themes/webkit/functions.php
Websites/webkit.org/wp-content/themes/webkit/widgets/post.php

index 3f5c6a2..db7c299 100644 (file)
@@ -1,3 +1,13 @@
+2019-06-05  Jon Davis  <jond@apple.com>
+
+        Improve accessibility on webkit.org
+        https://bugs.webkit.org/show_bug.cgi?id=198531
+
+        Reviewed by Devin Rousso.
+
+        * wp-content/themes/webkit/functions.php: Added menuitem ARIA role to links
+        * wp-content/themes/webkit/widgets/post.php: Added aria-label to SVG icons
+
 2019-06-04  Jon Davis  <jond@apple.com>
 
         Improve performance of the lazy image loader
index 3d249c4..f25e032 100644 (file)
@@ -435,7 +435,7 @@ class Responsive_Toggle_Walker_Nav_Menu extends Walker_Nav_Menu {
         $atts['target'] = ! empty( $item->target )     ? $item->target     : '';
         $atts['rel']    = ! empty( $item->xfn )        ? $item->xfn        : '';
         $atts['href']   = ! empty( $item->url )        ? $item->url        : '';
-        $atts['role']   = ! empty( $item->role )       ? $item->role       : '';
+        $atts['role']   = ! empty( $item->role )       ? $item->role       : 'menuitem';
 
         if ( in_array('menu-item-has-children', $item->classes) && 0 == $depth ) {
             $atts['aria-haspopup'] = "true";
index e3eb58b..98c0e4c 100644 (file)
@@ -68,7 +68,7 @@ class WebKitPostTileWidget extends WP_Widget {
                 <a class="tile-link" href="<?php the_permalink(); ?>"><?php echo $title; ?></a>
                 <div class="background-image">
                     <svg viewbox="0 0 100 100">
-                        <use xlink:href="#<?php echo esc_attr(get_post_icon()); ?>" />
+                        <use xlink:href="#<?php echo esc_attr(get_post_icon()); ?>" aria-label="<?php echo esc_attr(str_replace('-',' ', get_post_icon())); ?> icon" />
                     </svg>
                     <div class="featured-image"<?php echo $image; ?>></div>
                     <?php if ( $featured ): ?><div class="background-vignette"></div><?php endif; ?>