From 206b3c3bba96fc3a62637350fb9bfbae9a1703a9 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Tue, 5 Nov 2024 12:45:58 +0800 Subject: [PATCH] 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. --- .../local/htmlchecker/common/checks/img_alt_is_too_long.php | 4 ---- admin/tool/brickfield/lang/en/tool_brickfield.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/admin/tool/brickfield/classes/local/htmlchecker/common/checks/img_alt_is_too_long.php b/admin/tool/brickfield/classes/local/htmlchecker/common/checks/img_alt_is_too_long.php index 7963e14947b..2e0f1ad172b 100644 --- a/admin/tool/brickfield/classes/local/htmlchecker/common/checks/img_alt_is_too_long.php +++ b/admin/tool/brickfield/classes/local/htmlchecker/common/checks/img_alt_is_too_long.php @@ -30,10 +30,6 @@ use tool_brickfield\local\htmlchecker\common\brickfield_accessibility_test; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class img_alt_is_too_long extends brickfield_accessibility_test { - - /** @var int The default severity code for this test. */ - public $defaultseverity = \tool_brickfield\local\htmlchecker\brickfield_accessibility::BA_TEST_SEVERE; - /** * The main check function. This is called by the parent class to actually check content. */ diff --git a/admin/tool/brickfield/lang/en/tool_brickfield.php b/admin/tool/brickfield/lang/en/tool_brickfield.php index ed0e4f27410..972427377b0 100644 --- a/admin/tool/brickfield/lang/en/tool_brickfield.php +++ b/admin/tool/brickfield/lang/en/tool_brickfield.php @@ -179,7 +179,7 @@ $string['checkdesc:headerh3'] = 'Headers following after H3 headers (the editor $string['checkdesc:headershavetext'] = 'A header needs to contain text to be perceivable.'; $string['checkdesc:iisnotused'] = 'Italic (i) elements should not be used; "em" should be used instead.'; $string['checkdesc:imgaltisdifferent'] = 'Image alt (alternative) text should not be the image filename.'; -$string['checkdesc:imgaltistoolong'] = 'Image alt (alternative) text should not be more than the maximum allowed (125) characters.'; +$string['checkdesc:imgaltistoolong'] = 'Ensure that the image alt (alternative) text is concise enough to describe the image.'; $string['checkdesc:imgaltnotemptyinanchor'] = 'Image alt (alternative) text should not be empty, especially when the image has a link going elsewhere.'; $string['checkdesc:imgaltnotplaceholder'] = 'Image alt (alternative) text should not be a simple placeholder text, such as "image".'; $string['checkdesc:imghasalt'] = 'Image alt (alternative) text should not be missing for image elements, unless purely decorative with no meaning.';