From 7ecb5d1ccf2c6a5389b39c32cf4391b0ed721b31 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 7 Oct 2018 10:59:25 +0200 Subject: [PATCH] Changed role of nav/article elements without label to presentation See #2713 --- .../files/js/WoltLabSuite/Core/Bootstrap.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js index 733269da13..f3ed91268a 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Bootstrap.js @@ -14,14 +14,14 @@ define( 'Ui/SimpleDropdown', 'WoltLabSuite/Core/Ui/Mobile', 'WoltLabSuite/Core/Ui/TabMenu', 'WoltLabSuite/Core/Ui/FlexibleMenu', 'Ui/Dialog', 'WoltLabSuite/Core/Ui/Tooltip', 'WoltLabSuite/Core/Language', 'WoltLabSuite/Core/Environment', 'WoltLabSuite/Core/Date/Picker', 'EventHandler', 'Core', 'WoltLabSuite/Core/Ui/Page/JumpToTop', - 'Devtools' + 'Devtools', 'Dom/ChangeListener' ], function( favico, enquire, perfectScrollbar, DateTimeRelative, UiSimpleDropdown, UiMobile, UiTabMenu, UiFlexibleMenu, UiDialog, UiTooltip, Language, Environment, DatePicker, EventHandler, Core, UiPageJumpToTop, - Devtools + Devtools, DomChangeListener ) { "use strict"; @@ -97,6 +97,19 @@ define( window.jQuery.holdReady(false); } }, 20); + + this._initA11y(); + DomChangeListener.add('WoltLabSuite/Core/Bootstrap', this._initA11y.bind(this)); + }, + + _initA11y: function() { + elBySelAll('nav:not([aria-label]):not([role])', undefined, function(element) { + elAttr(element, 'role', 'presentation'); + }); + + elBySelAll('article:not([aria-label]):not([role])', undefined, function(element) { + elAttr(element, 'role', 'presentation'); + }); } }; }); -- 2.20.1