From cb401293c5fac3ab94a6909c9928fbea62ccad6b Mon Sep 17 00:00:00 2001 From: David Sn Date: Sat, 16 Dec 2017 01:39:35 +0000 Subject: [PATCH] Fix tooltip accessibility for screen readers By adding an additional aria-label attribute to the tooltip, we can ensure that every tooltip will be accessible for accessibility tools like screen readers. Works with Echo extension, but I am not sure if there are extensions who are using the original-title attribute. Tested with ChromeVox on Chrome 62.0.3202.94. Bug: T54711 Change-Id: I19500c4e8ccbdcb8288b9c2299a29b3f8a31639d --- includes/htmlform/fields/HTMLCheckMatrix.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/htmlform/fields/HTMLCheckMatrix.php b/includes/htmlform/fields/HTMLCheckMatrix.php index dd4e707ee5..df44626a3d 100644 --- a/includes/htmlform/fields/HTMLCheckMatrix.php +++ b/includes/htmlform/fields/HTMLCheckMatrix.php @@ -106,6 +106,7 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { $tooltipAttribs = [ 'class' => "mw-htmlform-tooltip $tooltipClass", 'title' => $this->mParams['tooltips'][$rowLabel], + 'aria-label' => $this->mParams['tooltips'][$rowLabel] ]; $rowLabel .= ' ' . Html::element( 'span', $tooltipAttribs, '' ); } -- 2.20.1