HTML 4.01 Test Suite - Assertions

Testable Assertions: Section 14 Style Sheets


Valid HTML 4.01!


14 Style Sheets - Adding style to HTML documents

Assertion 14.1-1

Reference: Section 14.1
(should) User agents should give users the opportunity to select from among alternate styles.
Tests: None

Assertion 14.1-2

Reference: Section 14.1
(should) User agents should give users the opportunity to switch off style sheets.
Tests: None

Assertion 14.2.1-1

Reference: Section 14.2.1
(author)(must) Authors must specify the style sheet language of style information associated with an HTML document.
Tests: None

Assertion 14.2.1-2

Reference: Section 14.2.1
(author)(should) Authors should use the META element to set the default style sheet language.
Tests: None

Assertion 14.2.1-3

Reference: Section 14.2.1
(author)(may) Authors may also set the default style sheet language with HTTP headers.
Tests: None

Assertion 14.2.1-4

Reference: Section 14.2.1
(should) User agents should determine the default style sheet language for a document according to the following steps (highest to lowest priority): 1. If any META declarations specify the "Content-Style-Type", the last one in the character stream determines the default style sheet language. 2. Otherwise, if any HTTP headers specify the "Content-Style-Type", the last one in the character stream determines the default style sheet language. 3. Otherwise, the default style sheet language is "text/css".
Tests: None

Assertion 14.2.2-1

Reference: Section 14.2.2
(must) The style attribute specifies style information for the current document. The syntax of its value is determined by the default style sheet language.
Tests: None

Assertion 14.2.2-2

Reference: Section 14.2.2
(author)(should) Authors should use the STYLE element to specify style information for more than one element.
Tests: None

Assertion 14.2.2-3

Reference: Section 14.2.2
(author)(should) For optimal flexibility, authors should define styles in external style sheets.
Tests: None

Assertion 14.2.3-1

Reference: Section 14.2.3
(author)(must) The start and end tags are required for the STYLE element.
Tests: None

Assertion 14.2.3-2

Reference: Section 14.2.3
(author)(must) type = content-type [CI] This attribute specifies the style sheet language of the element's contents and overrides the default style sheet language. The style sheet language is specified as a content type (e.g., "text/css"). Authors must supply a value for this attribute; there is no default value for this attribute.
Tests: None

Assertion 14.2.3-3

Reference: Section 14.2.3
(must) media = media-descriptors [CI] This attribute specifies the intended destination medium for style information. It may be a single media descriptor or a comma-separated list. The default value for this attribute is "screen".
Tests: None

Assertion 14.2.3-4

Reference: Section 14.2.3
(must) HTML permits any number of STYLE elements in the HEAD section of a document.
Tests: None

Assertion 14.2.3-5

Reference: Section 14.2.3
(must) User agents that don't support style sheets must hide the contents of the STYLE element.
Tests: None

Assertion 14.2.3-6

Reference: Section 14.2.3
(must) User agents that don't support the specific style sheet language used by a STYLE element must hide the contents of the STYLE element.
Tests: None

Assertion 14.2.3-7

Reference: Section 14.2.3
(must) User agents must not render the content of the STYLE element as part of the document's text.
Tests: None

Assertion 14.2.4-1

Reference: Section 14.2.4
(must) User agents must apply style sheets selectively based on the media attribute specified.
Tests: 14_2_4-BF-01.html

Assertion 14.3.1-1

Reference: Section 14.3.1
(must) HTML allows authors to associate any number of external style sheets with a document.
Tests: None

Assertion 14.3.1-2

Reference: Section 14.3.1
(should) User agents should allow users to select from alternate style sheets. (see 14.1-1)
Tests: None

Assertion 14.3.1-3

Reference: Section 14.3.1
(should) User agents should apply the author's preferred style sheet unless the user has selected a different alternate.
Tests: None

Assertion 14.3.1-4

Reference: Section 14.3.1
(must) When a user selects a named style, the user agent must apply all the style sheets with that name.
Tests: None

Assertion 14.3.1-5

Reference: Section 14.3.1
(must) User agents must apply persistent style sheets in addition to any alternate style sheet.
Tests: None

Assertion 14.3.1-6

Reference: Section 14.3.1
(must) User agents must respect media descriptors (see 14.2.3-2 and section 6.13).
Tests: None

Assertion 14.3.1-7

Reference: Section 14.3.1
(should) User agents should allow users to disable the author's style sheets entirely.
Tests: None

Assertion 14.3.1-8

Reference: Section 14.3.1
(must) If the user agent disables the author's style sheets entirely (see 14.3.1-7), the user agent must not apply any persistent or alternate style sheets.
Tests: None

Assertion 14.3.2-1

Reference: Section 14.3.2
(must) User agents must allow external style sheets to be associated with the document using the LINK element.
Tests: 14_3_2-BF-01.html

Assertion 14.3.2-2

Reference: Section 14.3.2
(must) The href attribute of the LINK element specifies the location of the style sheet file. The value of href is a URI (section 6-4)
Tests: 14_3_2-BF-01.html

Assertion 14.3.2-3

Reference: Section 14.3.2
(must) The type attribute of the LINK element indicates the language of the linked resource, in this case a style sheet.
Tests: 14_3_2-BF-01.html

Assertion 14.3.2-4

Reference: Section 14.3.2
(may) The user agent may avoid downloading a style sheet for an unsupported style sheet language.
Tests: None

Assertion 14.3.2-5

Reference: Section 14.3.2
(must) A style sheet is persistent when the rel attribute of the LINK element is set to "stylesheet" and the title attribute of the LINK element is not set.
Tests: 14_3_2-BF-02.html

Assertion 14.3.2-6

Reference: Section 14.3.2
(must) A style sheet is preferred when the rel attribute of the LINK element is set to "stylesheet" and the title attribute of the LINK element is set.
Tests: 14_3_2-BF-03.html

Assertion 14.3.2-7

Reference: Section 14.3.2
(must) A style sheet is alternate when the rel attribute of the LINK element is set to "alternate stylesheet" and the title attribute of the LINK element is set.
Tests: 14_3_2-BF-03.html

Assertion 14.3.2-8

Reference: Section 14.3.2
(should) User agents should provide a means for users to view and pick from the list of alternate styles.
Tests: None

Assertion 14.3.2-9

Reference: Section 14.3.2
(should) The value of the title attribute is recommended as the name of each choice in 14.3.2-8.
Tests: None

Assertion 14.3.2-10

Reference: Section 14.3.2
(must) The META element may be used to set the document's preferered style sheet. (Note: Since an author may do it, the user agent must support it.)
Tests: None

Assertion 14.3.2-11

Reference: Section 14.3.2
(must) The preferred style sheet may also be specified with HTTP headers. (Note: Since an author may do it, the user agent must support it.)
Tests: None

Assertion 14.3.2-12

Reference: Section 14.3.2
(must) If two or more META declarations or HTTP headers specify the preferred style sheet, the last one takes precedence. HTTP headers are considered to occur earlier than the document HEAD for this purpose.
Tests: None

Assertion 14.3.2-13

Reference: Section 14.3.2
(must) If two or more LINK elements specify a preferred style sheet, the first one takes precedence.
Tests: None

Assertion 14.3.2-14

Reference: Section 14.3.2
(must) Preferred style sheets specified with META or HTTP headers have precedence over those specified with the LINK element.
Tests: None

Assertion 14.4.1-1

Reference: Section 14.4.1
(must) Style information is cascaded in the order the elements appear in the HEAD.
Tests: None

Assertion 14.4.1-2

Reference: Section 14.4.1
(must) The user agent is responsible for filtering out those style sheets that do not apply to the current medium.
Tests: None

Assertion 14.4.2-1

Reference: Section 14.4.2
(must) When the user agent wants to render a document, it needs to find values for style properties, e.g. the font family, font style, size, line height, text color and so on.
Tests: None

Assertion 14.5-1

Reference: Section 14.5
(must) CSS allows commenting out of styles in the STYLE element to ensure that non-conforming user agents will not render them as text. Conforming user agents must apply the styles if they are commented out in the STYLE element.
Tests: None