All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S5264.html Maven / Gradle / Ivy

There is a newer version: 10.20.0.29356
Show newest version

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.

<object></object> <!-- Noncompliant -->

<object>
  <object></object> <!-- Noncompliant -->
</object>

Provide alternative content to <object> elements.

<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

Related rules

  • Web:ImgWithoutAltCheck




© 2015 - 2025 Weber Informatics LLC | Privacy Policy