From: Matthew Fernandez Date: Fri, 25 Nov 2022 18:23:46 +0000 (-0800) Subject: Revert "core plugin: stop emitting an empty 'alt' tag in cmap output" X-Git-Tag: 7.0.4~7^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3e26c2e4cf7d2a2554337d241e5466482c92a2f;p=graphviz Revert "core plugin: stop emitting an empty 'alt' tag in cmap output" This reverts commit a214b9dc2be6b4a9d27196e2c43f7bf2b0ff0002. It turns out the W3C specification for this part of HTML requires the `alt` attribute if the `href` attribute is set. We will need to figure out an alternative of what to set this to for accessibility. Gitlab: closes #2319, re-opens #265 Reported-by: Albert --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 64fccf4ab..338279d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased (7.0.4)] +### Fixed + +- The `alt` attributes are once again set in the cmap output. This was a + regression in Graphviz 7.0.2, that intentionally removed these but did not + account for the W3C specification making these attributes required when the + `href` attribute is set. #265, #2319 + ## [7.0.3] – 2022-11-26 ### Changed diff --git a/plugin/core/gvrender_core_map.c b/plugin/core/gvrender_core_map.c index a5a304e3d..3f62d4a37 100644 --- a/plugin/core/gvrender_core_map.c +++ b/plugin/core/gvrender_core_map.c @@ -114,6 +114,17 @@ static void map_output_shape (GVJ_t *job, map_shape_t map_shape, pointf * AF, in gvputs_xml(job, tooltip); gvputs(job, "\""); } + /* + * alt text is intended for the visually impaired, but such + * folk are not likely to be clicking around on a graph anyway. + * IE on the PC platform (but not on Macs) incorrectly + * uses (non-empty) alt strings instead of title strings for tooltips. + * To make tooltips work and avoid this IE issue, + * while still satisfying usability guidelines + * that require that there is always an alt string, + * we generate just an empty alt string. + */ + gvputs(job, " alt=\"\""); gvputs(job, " coords=\""); switch (map_shape) {