From 9a74c7b99bf0ac901f86bb38372a68e157cf9c73 Mon Sep 17 00:00:00 2001 From: Cameron Cundiff Date: Wed, 16 Aug 2017 14:34:02 -0400 Subject: Do not generate default alt text in image tags - Auto-generating content from the filename of an image is not suitable alternative text; alt text that isn't fully considered can be distracting and fatiguing for screen readers users (blind, low vision, dyslexic people). - Setting a filename fallback short circuits screen reader default behavior and configuration for blank descriptions. - Setting poor defaults also creates false negatives for accessibility linting and testing software, that makes it harder to improve application accessibility. *** - After this change, if authors leave images without alt text, screen readers will fallback to default behavior for missing alt text. - Also with this change, Automated linting and testing tools will correctly generate warnings. [Fixes #30096] --- activestorage/test/template/image_tag_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activestorage/test/template/image_tag_test.rb') diff --git a/activestorage/test/template/image_tag_test.rb b/activestorage/test/template/image_tag_test.rb index 46dd97b3e9..dedc58452e 100644 --- a/activestorage/test/template/image_tag_test.rb +++ b/activestorage/test/template/image_tag_test.rb @@ -11,17 +11,17 @@ class ActiveStorage::ImageTagTest < ActionView::TestCase end test "blob" do - assert_dom_equal %(Racecar), image_tag(@blob) + assert_dom_equal %(), image_tag(@blob) end test "variant" do variant = @blob.variant(resize: "100x100") - assert_dom_equal %(Racecar), image_tag(variant) + assert_dom_equal %(), image_tag(variant) end test "attachment" do attachment = ActiveStorage::Attachment.new(blob: @blob) - assert_dom_equal %(Racecar), image_tag(attachment) + assert_dom_equal %(), image_tag(attachment) end test "error when attachment's empty" do -- cgit v1.2.3