Contribution to the HTML 4.01 Test Suite - Assertions

Testable Assertions: Section 7 The global structure of an HTML document


Valid HTML 4.01!


7 The global structure of an HTML document - The HEAD and BODY of a document

Assertion 7.1-1

Reference: Section 7.1
(author)(must) An HTML document is composed of three parts: An HTML 4 document is composed of three parts: 1. a line containing HTML version information, 2. a declarative header section (delimited by the HEAD element), 3. a body, which contains the document's actual content.
Tests:

Assertion 7.1-2

Reference: Section 7.1
(must) White space (spaces, newlines, tabs and comments) may appear before or after each section of an HTML document. [NOTE: Authors may do it, meaning that user agents must support it.]
Tests:

Assertion 7.1-3

Reference: Section 7.1
(author)(should) The head and body of an HTML document should be delimited by the HTML element.
Tests:

Assertion 7.2-1

Reference: Section 7.2
(author)(must) A valid HTML document declares what version of HTML is used in the document. The document type declaration names the document type definition (DTD) in use for the document.
Tests:

Assertion 7.3-1

Reference: Section 7.3
(author)(must) HTML element: The start tag and end tag are required.
Tests:

Assertion 7.3-2

Reference: Section 7.3
(must)(deprecated) version = cdata [CN] Deprecated. The value of this attribute specifies which HTML DTD version governs the current document. This attribute has been deprecated because it is redundant with version information provided by the document type declaration.
Tests:

Assertion 7.3-3

Reference: Section 7.3
(author)(must) After document type declaration, the remainder of an HTML document is contained by the HTML element.
Tests:

Assertion 7.4.1-1

Reference: Section 7.4.1
(author)(must) HEAD: The start tag and end tag are optional.
Tests:

Assertion 7.4.1-2

Reference: Section 7.4.1
(must) HEAD profile = uri [CT] This attribute specifies the location of one or more meta data profiles, separated by white space. For future extensions, user agents should consider the value to be a list even though this specification only considers the first URI to be significant.
Tests:

Assertion 7.4.1-3

Reference: Section 7.4.1
(should) User agents do not generally render elements that appear in the HEAD as content.
Tests:

Assertion 7.4.2-1

Reference: Section 7.4.2
(author)(must) TITLE: The start tag and end tag are required.
Tests:

Assertion 7.4.2-2

Reference: Section 7.4.2
(author)(must) Every HTML document must have a TITLE element in the HEAD section.
Tests:

Assertion 7.4.2-3

Reference: Section 7.4.2
(author)(should) Authors should use the TITLE element to provide context-rich titles to identify the contents of a document.
Tests:

Assertion 7.4.2-4

Reference: Section 7.4.2
(must) User agents must always make the content of the TITLE element available to users, including TITLE elements that occur in frames. The mechanism for doing so depends on the user agent.
Tests: 7_4_2-BF-01.html, 7_4_2-BF-02.html

Assertion 7.4.2-5

Reference: Section 7.4.2
(must) Titles may contain character entities. [NOTE: Since authors may do it, user agents must support it.]
Tests:

Assertion 7.4.2-6

Reference: Section 7.4.2
(author)(must) Titles may not contain other markup, including comments.
Tests:

Assertion 7.4.3-1

Reference: Section 7.4.3
(author)(must) title = text [CS] This attribute offers advisory information about the element for which it is set.
Tests:

Assertion 7.4.3-2

Reference: Section 7.4.3
(may) Values of the title attribute may be rendered by user agents in a variety of ways.
Tests:

Assertion 7.4.4-1

Reference: Section 7.4.4
(may) In general, specifying meta data involves two steps: 1. Declaring a property and a value for that property. This may be done in two ways: a. From within a document, via the META element. b. From outside a document, by linking to meta data via the LINK element (see the section on link types). 2. Referring to a profile where the property and its legal values are defined. To designate a profile, use the profile attribute of the HEAD element.
Tests:

Assertion 7.4.4-2

Reference: Section 7.4.4
(author)(must) META: The start tag is required and the end tag is forbidden.
Tests:

Assertion 7.4.4-3

Reference: Section 7.4.4
(may) META: http-equiv = name [CI] This attribute may be used in place of the name attribute. HTTP servers use this attribute to gather information for HTTP response message headers.
Tests:

Assertion 7.5.1-1

Reference: Section 7.5.1
(author)(must) BODY: The start tag and end tag are optional.
Tests:

Assertion 7.5.1-2

Reference: Section 7.5.1
(should)(deprecated) BODY: background = uri [CT] The value of this attribute is a URI that designates an image resource. The image generally tiles the background (for visual browsers).
Tests:

Assertion 7.5.1-3

Reference: Section 7.5.1
(must)(deprecated) BODY: text = color [CI] This attribute sets the foreground color for text (for visual browsers).
Tests:

Assertion 7.5.1-4

Reference: Section 7.5.1
(must)(deprecated) BODY: link = color [CI] This attribute sets the color of text marking unvisited hypertext links (for visual browsers).
Tests:

Assertion 7.5.1-5

Reference: Section 7.5.1
(must)(deprecated) BODY: vlink = color [CI] This attribute sets the color of text marking visited hypertext links (for visual browsers).
Tests:

Assertion 7.5.1-6

Reference: Section 7.5.1
(must)(deprecated) BODY: alink = color [CI] This attribute sets the color of text marking hypertext links when selected by the user (for visual browsers).
Tests:

Assertion 7.5.1-7

Reference: Section 7.5.1
(author)(must) The body of a document contains the document's content.
Tests:

Assertion 7.5.2-1

Reference: Section 7.5.2
(author)(must) id = name [CS] This attribute assigns a name to an element. This name must be unique in a document.
Tests:

Assertion 7.5.2-2

Reference: Section 7.5.2
(author)(must) class = cdata-list [CS] This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.
Tests:

Assertion 7.5.4-1

Reference: Section 7.5.4
(author)(must) SPAN and DIV: The start tag and end tag are required.
Tests:

Assertion 7.5.4-2

Reference: Section 7.5.4
(must) The DIV element defines its content to be block-level, but imposes no other presentational idioms on the content.
Tests: 7_5_4-BF-01.html

Assertion 7.5.4-3

Reference: Section 7.5.4
(must) The SPAN element defines its content to be inline, but imposes no other presentational idioms on the content.
Tests: 7_5_4-BF-02.html

Assertion 7.5.4-4

Reference: Section 7.5.4
(should) Visual user agents generally place a line break before and after DIV elements.
Tests:

Assertion 7.5.5-1

Reference: Section 7.5.5
(author)(must) H1, H2, H3, H4, H5 and H6: The start tag and end tag are required.
Tests:

Assertion 7.5.5-2

Reference: Section 7.5.5
(should) There are six levels of headings in HTML with H1 as the most important and H6 as the least. Visual browsers usually render more important headings in larger fonts than less important ones.
Tests: 7_5_5-BF-01.html

Assertion 7.5.6-1

Reference: Section 7.5.6
(author)(must) ADDRESS: The start tag and end tag are required.
Tests: