Problem/Motivation
The SVG files live in standalone files now, but they previously were embedded in page template files.
They still have some <title> and <desc> elements inside them, which should be removed because:
- They are not guaranteed to be appropriate for the situation the are presented in.
- It's better for text alternatives to be specified by the templates and/or content that includes them them, according to context.
- They are English phrases which are not translatable
Proposed resolution
- Remove the
<title> and <desc> elements form the SVG files.
- Also remove any
aria-labelledby and.or aria-describedby attributes which refer to these by ID reference.
- Preserve other attirbutes that are part of SVG and not ARIA.
Example...
Before:
<svg aria-labelledby="menu-toggle-title menu-toggle-desc">
<title id="menu-toggle-title">Menu toggle icon</title>
<desc id="menu-toggle-desc">Hamburger icon for menu toggle.</desc>
// ... the graphic parts
</svg>
After:
<svg>
// ... the graphic parts
</svg>
Remaining tasks
Examine each SVG file for these issues
TODO: make a list of SVG files, cross them off when done.
User interface changes
none.
API changes
none.
Data model changes
none.
Original report
Follow-up from earlier issue in https://github.com/lauriii/umami/issues/138
Comments
Comment #2
bn_code commentedComment #3
bn_code commentedList of svg files with changes:
cake.svg - title
chefs-hat.svg - title
health.svg - title
learn-to-cook.svg - title
menu-icon.svg - title, desc, attr aria-labelledby
pointer.svg - title
Comment #4
bn_code commentedComment #5
markconroy commentedPatch applies cleanly. I can't see any SVGs with titles or desc tags. Moving to RTBC.
Thanks for the patch.
Comment #6
markconroy commentedComment #7
alexpottWhat's odd to me is that only pointer, pointer--white and search SVGs seem to be used. Is there any reason we are keeping the rest about. And at least with the pointer SVG we're losing info because it's being used as a background image. Not sure what's the right thing to do here.
Comment #8
andrewmacpherson commentedNo we aren't - CSS background images aren't conveyed to accessibility APIs at all, so the
<title>in pointer.svg is not serving as a text alternative. In this case, it's being used as a decorative image only. The pointer icon doesn't need a text alternative, accessibility APIs get told it has an AccessibleRole of "link".SVG title elements can serve as text alternatives, but there are more are more reliable approaches, such as
altoraria-labelledbyin HTML. The SVG<title>and<desc>elements that are currently there are not serving as text alternatives:aria-labelattribute (menu-icon).Another problem with these title and desc elements is that they are not translatable, at least in standalone SVG files. They can be made translatable, but only where they are in twig files.
The difficulty, knife, serves, and timer icons appear on the recipe page. The standalone SVGs are not used though, instead the recipe node template has some embedded SVGs. Maybe some template clean-up was started, but not finished?
Standalone SVG files which are currently used:
Standalone SVG files which are not used, but have equivalent copies in the recipe node template:
Perhaps some clean-up plan was started but not finished - should these be tidied up, removing either the standalone files or the embedded ones? In any case the SVG
<title>is duplicating visible text immediately next to the icon, so isn't necessary as a text-alternative. For example we hear "Preparation icon, preparation time 10 minutes", which is (a) just too verbose, and (b) doesn't rely on the fact that it's a knife - the whisk would do just as well here.Standalone SVGs not being used - are they still needed?
Comment #9
ckrinaSome of this icons will be needed here: #2943353: Umami Theme - Quick links block homepage, and I guess depending how the block is created it will influence this issue.
Comment #10
andrewmacpherson commented@ckrina We can postpone this until we know what's happening with the quick links block, if you like
Comment #11
ckrinaMaybe, instead of blocking this issue, they could be added in the patch for #2943353: Umami Theme - Quick links block homepage and deleted here.
Comment #12
ckrinaI've just added a patch to #2943353: Umami Theme - Quick links block homepage with @bn_code changes on the 4 SVGs needed so they can be safely removed (or not) here.
Comment #14
eli-tAll the svgs not currently used but intended to be implemented in future work are included on the issue #2943353
Therefore we can safely delete them from this issue
cake.svg
chef-hat.svg
health.svg
spoon.svg
whisk.svg
These svgs are now used as files and are no longer embedded in the recipe node template so should not be removed as hypothesized in
difficulty.svg
knife.svg
serves.svg
timer.svg
The embedded title and desc elements and referring aria references to them should be deleted as detailed originally by @andrewmacpherson in the issue summary. Some of this may be in the latest patch.
Comment #15
andrewmacpherson commentedThe "umami logo" in logo.svg is another unnecessary title element. The alt text for that comes from the branding block template, and is translatable there.
Comment #16
tim.cox commentedI have modified the patch in #3 to also remove the title element from logo.svg as requested by #15.
Comment #17
pawandubey commentedI have tested the patch#16 and its working fine.
Just wanted to highlight few things:
1. Do we have to minify the following SVG files like other SVG files?
2. In the patch#16, no changes applied to search.svg file where there is still
<title>tag available which is used as a background-image for<input>tag. Following is the HTML code of search where the image is applied in background:<input title="Enter the terms you wish to search for." placeholder="Search by keyword, ingredient, dish" data-drupal-selector="edit-keys" type="search" id="edit-keys" name="keys" value="" size="15" maxlength="128" class="form-search">I have re-rolled the patch with the both above changes. Please let me know if any further changes are require in this or if this change not require then patch#16 is verified any you can share the feedback accordingly.
Comment #18
andrewmacpherson commented@pawandubey - thanks for the updated patch. Can you provide an interdiff to show what's changed between #16 and #17?
Comment #19
pawandubey commented@andrewmacpherson
Please find the attached interdiff file and let me know your thought on the patch.
Comment #20
volkswagenchickTagging for upcoming contribution days.
Comment #21
volkswagenchickComment #23
gobinathmTagging for the SeattleCon's Mentored Contribution Sprint
Comment #24
bCounts commentedI'm In the Druaplcon Novice room and will look into this.
Comment #25
pawandubey commentedI have re-rolled the patch#17 as per the latest changes in 8.8.x version.
Currently, interdiff is not possible for it, please review the same and let me know your feedback.
Comment #26
tatarbjComment #27
bCounts commentedI reviewed the interdiff_16-17.txt and the latest patch. I found the following changes:
Minified like other SVG files:
learn-to-cook.svg
serves.svg
spoon.svg
timer.svg
whisk.svg
knife.svg
Title removed and minified:
cake.svg
chefs-hat.svg
health.svg
pointer.svg
search.svg
logo.svg
Minified and additional content removed as detailed:
' -menu-icon.svg - Removed 'aria-labelledby="menu-toggle-title menu-toggle-desc">Menu toggle iconHamburger icon for menu toggle.-difficulty.svg - Removed '
Comment #28
bCounts commentedI reviewed the interdiff_16-17.txt and the latest patch. I found the following changes:
Minified like other SVG files:
learn-to-cook.svg
serves.svg
spoon.svg
timer.svg
whisk.svg
knife.svg
Title removed and minified:
cake.svg
chefs-hat.svg
health.svg
pointer.svg
search.svg
logo.svg
Minified and additional content removed as detailed:
' -menu-icon.svg - Removed 'aria-labelledby="menu-toggle-title menu-toggle-desc">Menu toggle iconHamburger icon for menu toggle.-difficulty.svg - Removed '
Comment #29
aaronmchaleComment #30
sushma9 commentedI have picked this up.
+DCScot19
Comment #31
sushma9 commentedI have reviewed the latest patch in #25.
The title is removed for the below svg's:
cake.svg
chefs-hat.svg
health.svg
learn-to-cook.svg
pointer.svg
logo.svg
menu-icon.svg
Below svg's are minified:
difficulty.svg
knife.svg
search.svg
serves.svg
spoon.svg
timer.svg
whisk.svg
Comment #32
sushma9 commentedComment #34
alexpottvimeo was down - #3059022: If Vimeo is down our tests break
Comment #36
pawandubey commentedComment #37
catchCommitted db82a8e and pushed to 8.8.x. Thanks!