rspec/rules/S5264/html/rule.adoc

63 lines
1.7 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Assistive technologies, such as screen readers, will not be able to render ``++<object>++`` elements, in such cases it is the content of the ``++<object>++`` which is provided to the user. This alternative content needs to be accessible or the screen readers won't be able to use it. For example, if an ``++<img>++`` is used it must contain an ``++alt++`` attribute (see corresponding rule Web:ImgWithoutAltCheck).
This rule raises an issue when an ``++<object>++`` tag does not have any alternative content.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,html]
2021-04-28 16:49:39 +02:00
----
<object></object> <!-- Noncompliant -->
<object>
<object></object> <!-- Noncompliant -->
</object>
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,html]
2021-04-28 16:49:39 +02:00
----
<object>This application shows the simulation of two particles colliding</object>
<object>
<img src="flower.png" alt="Flower growing in a pot" />
</object>
<object>
<object>
This application shows the simulation of two particles colliding
</object>
</object>
----
== Resources
2021-04-28 16:49:39 +02:00
* https://www.w3.org/TR/WCAG20-TECHS/H53.html[WCAG2, H53] - Using the body of the object element
* https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0#qr-text-equiv-all[WCAG2, 1.1.1] - Non-text Content
* https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0#qr-media-equiv-audio-desc[WCAG2, 1.2.3] - Audio Description or Media Alternative (Prerecorded)
* https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0#qr-media-equiv-text-doc[WCAG2, 1.2.8] - Media Alternative (Prerecorded)
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Add an accessible content to this "<object>" tag.
=== Highlighting
The opening <object> tag without its content
endif::env-github,rspecator-view[]