Rule 10.1.2

Summary

This test consists in checking whether the page doesn’t contain attributes serving for the presentation of the information in the source code.

Business description

Criterion

10.1

Test

10.1.2

Description

Dans chaque page web, les attributs servant à la présentation de l’information ne doivent pas être présents dans le code source généré des pages. Cette règle est-elle respectée ?

Level

A

Technical description

Scope

Page

Decision level

Decidable

Algorithm

Selection

Set1

All the attributes defined as deprecated:

  • align
  • alink
  • background
  • bgcolor
  • border
  • cellpadding
  • cellspacing
  • char
  • charoff
  • clear
  • compact
  • color
  • frameborder
  • hspace
  • link
  • marginheight
  • marginwidth
  • text
  • valign
  • vlink
  • vspace
  • size
  • width except for <img>, <svg>, <object>, <embed> and <canvas> tags
  • height except for <img>, <svg>, <object>, <embed> and <canvas> tags

Used:

  • nomenclature DeprecatedRepresentationAttributesV3

  • CSS selector:

    :not(img):not(svg):not(object):not(embed):not(canvas)[width]
    :not(svg [width])
    
    :not(img):not(svg):not(object):not(embed):not(canvas)[height]
    :not(svg [height])
    

Process

Test1

For each element of Set1, raise a MessageA

Message A : Presentation attribute found
  • code: PresentationAttrFound
  • status: Failed
  • parameter: tag name
  • present in source: yes

Analysis

Passed

No deprecated tag found on the page (Set1 is empty).

Failed

the document contains tags with deprecated atttributes (Set1 is not empty)

Notes

  • This rule may be tested for each kind of doctype.
  • The current implementation only tests the forbidden attributes.

Files