rspec/rules/S1925/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

43 lines
1.3 KiB
Plaintext

== Why is this an issue?
The ``++ismap++`` attribute in an img tag creates a server-side image map: The browser sends the coordinates of the clicked point to the server. For any person who cannot use a mouse, this form of navigation is inaccessible because it is the position of the cursor on the image that determines the action.
On the other hand, client-side image maps, which use the usemap attribute allow for each clickable area to specify an alternate text, enabling accessibility for the blind. Further, in terms of separation of concerns, it is definitely better to leave the task of mapping pixels to links to the client.
=== Noncompliant code example
[source,text]
----
<a href="click_on_world_map.php" target="_self">
<img src="world_map.png" ismap> <!-- Non-Compliant -->
</a>
----
=== Compliant solution
[source,text]
----
<img src="world_map.png" usemap="#world_map"> <!-- Compliant -->
<map name="world_map">
<area shape="rect" coords="0,0,10,10" href="france.html" alt="France">
<area shape="circle" coords="20,20,10" href="spain.html" alt="Spain">
<area shape="circle" coords="30,30,8" href="england.html" alt="England">
<!-- ... -->
</map>
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== duplicates: S1091
endif::env-github,rspecator-view[]