rspec/rules/S5264/why.adoc
github-actions[bot] 2e71406bdc
Create rule S5264 (#3889)
* Add javascript to rule S5264

* Add rule S5264 to JS

---------

Co-authored-by: vdiez <vdiez@users.noreply.github.com>
Co-authored-by: Victor <victor.diez@sonarsource.com>
2024-04-17 15:24:34 +02:00

16 lines
1.0 KiB
Plaintext

== Why is this an issue?
The ``++<object>++`` HTML element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin. The element's children are the fallback content. This allows multiple object elements to be nested inside each other, targeting multiple user agents with different capabilities, with the user agent picking the first one it supports.
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.
This rule raises an issue when an ``++<object>++`` tag does not have any alternative content.
[source,html,diff-id=1,diff-type=noncompliant]
----
<object></object> <!-- Noncompliant -->
<object>
<object></object> <!-- Noncompliant -->
</object>
----