From 687c6a50d866dc32922885ef9cdbe16faf4ca656 Mon Sep 17 00:00:00 2001 From: bwang Date: Tue, 18 May 2021 13:27:33 -0500 Subject: [PATCH] Improve heading structure and heading semantics by removing redundant headings and labels for modern Vector - Apply aria-hidden to h3 in Menu template, ensuring the nav landmarks are still properly labeled, but no longer reading duplicate labels to screenreaders - Remove "Navigation menu" h2 element, which is not needed as the nav landmarks are already labeled - Remove searchbox h3 element, which is redundant with the search landmark - Scope all changes to modern vector Bug: T265993 Change-Id: I4e5da7a0699160fa57234bd126b75243e0157778 --- includes/SkinVector.php | 2 ++ includes/templates/Menu.mustache | 5 +++-- includes/templates/Navigation.mustache | 1 - includes/templates/SearchBox.mustache | 8 +++++--- includes/templates/skin-legacy.mustache | 3 +-- includes/templates/skin.mustache | 1 - resources/common/components/SearchBox.less | 5 ----- .../skins.vector.styles.legacy/components/SearchBox.less | 6 ++++++ resources/skins.vector.styles.legacy/layouts/screen.less | 6 ------ resources/skins.vector.styles.legacy/skin-legacy.less | 1 + resources/skins.vector.styles/layouts/screen.less | 6 ------ 11 files changed, 18 insertions(+), 26 deletions(-) create mode 100644 resources/skins.vector.styles.legacy/components/SearchBox.less diff --git a/includes/SkinVector.php b/includes/SkinVector.php index 8f3c5e764..e3958762a 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -345,6 +345,8 @@ class SkinVector extends SkinMustache { // Conditionally used values must use null to indicate absence (not false or ''). $commonSkinData = array_merge( $parentData, [ + 'is-legacy' => $this->isLegacy(), + 'is-article' => (bool)$out->isArticle(), 'is-anon' => $this->getUser()->isAnon(), diff --git a/includes/templates/Menu.mustache b/includes/templates/Menu.mustache index c47847754..81c30a13a 100644 --- a/includes/templates/Menu.mustache +++ b/includes/templates/Menu.mustache @@ -12,8 +12,9 @@ data-event-name="ui.dropdown-{{id}}" class="{{#checkbox-class}}{{.}}{{/checkbox-class}} vector-menu-checkbox" aria-labelledby="{{id}}-label" /> {{/is-dropdown}} -

{{! - }}{{{html-vector-heading-icon}}} {{label}} +

+ {{{html-vector-heading-icon}}} + {{label}} {{#is-dropdown}} {{msg-vector-menu-checkbox-expanded}} {{msg-vector-menu-checkbox-collapsed}} diff --git a/includes/templates/Navigation.mustache b/includes/templates/Navigation.mustache index 5bbd5e99a..9eac40640 100644 --- a/includes/templates/Navigation.mustache +++ b/includes/templates/Navigation.mustache @@ -1,5 +1,4 @@
-

{{msg-navigation-heading}}

{{#data-portlets-sidebar}}{{>Sidebar}}{{/data-portlets-sidebar}}
diff --git a/includes/templates/SearchBox.mustache b/includes/templates/SearchBox.mustache index 70e6eba84..478791b0b 100644 --- a/includes/templates/SearchBox.mustache +++ b/includes/templates/SearchBox.mustache @@ -3,9 +3,11 @@ }}