Skip to content

Commit d05450f

Browse files
committed
MDL-83634 tool_brickfield: Downgrade image alt text check's severity
Given that * There is no formally defined limit for alt text length, * Current versions of screen readers can read alt texts longer than 125 characters, * Accessibility checkers like axe DevTools, WAVE, etc., do not raise errors or warnings about long image alt texts. This patch: - Downgrades the default severity for the `img_alt_is_too_long` check from `BA_TEST_SEVERE` to `BA_TEST_SUGGESTION`. - Updates the `checkdesc:imgaltistoolong` lang string to be more of a reminder/suggestion rather than an error.
1 parent 5670447 commit d05450f

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Diff for: admin/tool/brickfield/classes/local/htmlchecker/common/checks/img_alt_is_too_long.php

-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3131
*/
3232
class img_alt_is_too_long extends brickfield_accessibility_test {
33-
34-
/** @var int The default severity code for this test. */
35-
public $defaultseverity = \tool_brickfield\local\htmlchecker\brickfield_accessibility::BA_TEST_SEVERE;
36-
3733
/**
3834
* The main check function. This is called by the parent class to actually check content.
3935
*/

Diff for: admin/tool/brickfield/lang/en/tool_brickfield.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
$string['checkdesc:headershavetext'] = 'A header needs to contain text to be perceivable.';
180180
$string['checkdesc:iisnotused'] = 'Italic (i) elements should not be used; "em" should be used instead.';
181181
$string['checkdesc:imgaltisdifferent'] = 'Image alt (alternative) text should not be the image filename.';
182-
$string['checkdesc:imgaltistoolong'] = 'Image alt (alternative) text should not be more than the maximum allowed (125) characters.';
182+
$string['checkdesc:imgaltistoolong'] = 'Ensure that the image alt (alternative) text is concise enough to describe the image.';
183183
$string['checkdesc:imgaltnotemptyinanchor'] = 'Image alt (alternative) text should not be empty, especially when the image has a link going elsewhere.';
184184
$string['checkdesc:imgaltnotplaceholder'] = 'Image alt (alternative) text should not be a simple placeholder text, such as "image".';
185185
$string['checkdesc:imghasalt'] = 'Image alt (alternative) text should not be missing for image elements, unless purely decorative with no meaning.';

0 commit comments

Comments
 (0)