SIA-R74Paragraphs of text do not have font sizes defined in absolute units

Accessibility requirements

This rule tests conformance of the following accessibility requirements:

Description

This rule checks that paragraphs of text do not have font sizes that are defined as absolute lengths.

Applicability

This rule applies to every element with a semantic role of paragraph, visible textual content, and a cascaded font-size property.

Expectations

  1. The element does not have a cascaded font-size property that is specified as an absolute length.

Assumptions

This rule makes the following assumptions:

  • Elements with a role of paragraph are used for blocks of text.

  • No mechanism is available to change the font size of the text.

Accessibility support

This rule has no known accessibility support concerns.

Examples

Passed

The font size of this paragraph is specified using a relative unit and therefore passes the rule:

<style>
    p {
        font-size: 1em;
    }
</style>

<p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec diam
    ullamcorper, cursus nulla non, congue purus. Cras vehicula risus lacus, ac
    placerat diam vestibulum a. Maecenas lobortis enim interdum nisl vehicula
    eleifend. Sed et velit nulla.
</p>

Failed

The font size of this paragraph is specified using an absolute unit and therefore fails the rule:

<style>
    p {
        font-size: 12px;
    }
</style>

<p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec diam
    ullamcorper, cursus nulla non, congue purus. Cras vehicula risus lacus, ac
    placerat diam vestibulum a. Maecenas lobortis enim interdum nisl vehicula
    eleifend. Sed et velit nulla.
</p>

Inapplicable

This paragraph of text is hidden and is therefore inapplicable:

<p hidden>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec diam
    ullamcorper, cursus nulla non, congue purus. Cras vehicula risus lacus, ac
    placerat diam vestibulum a. Maecenas lobortis enim interdum nisl vehicula
    eleifend. Sed et velit nulla.
</p>