HTML 4.01 Test Suite - Assertions

Testable Assertions: Section 12 Links


Valid HTML 4.01!


12 Links - Hypertext and Media-Independent Links

Assertion 12.1-1

Reference: Section 12.1
(author)(may) The "destination" anchor may be any Web resource (e.g., an image, a video clip, a sound bite, a program, an HTML document, an element within an HTML document, etc
Tests: None

Assertion 12.1.1-1

Reference: Section 12.1.1
(must) The retrieval of another Web resource is commonly and implicitly obtained by selecting the link (e.g., by clicking, through keyboard input, etc.).
Tests: None

Assertion 12.1.1-2

Reference: Section 12.1.1
(must) The destination anchor of a link may be an element within an HTML document.
Tests: None

Assertion 12.1.1-3

Reference: Section 12.1.1
(must) The href attribute in each source anchor specifies the address of the destination anchor with a URI.
Tests: 12_1_1-BF-03.html

Assertion 12.1.1-4

Reference: Section 12.1.1
(may) Destination anchors in HTML documents may be specified either by the A element (naming it with the name attribute), or by any other element (naming with the id attribute).
Tests: None

Assertion 12.1.2-1

Reference: Section 12.1.2
(informative) The roles of a link defined by A or LINK are specified via the rel and rev attributes.
Tests: None

Assertion 12.1.2-2

Reference: Section 12.1.2
(must) Links specified by LINK are not rendered with the document's contents, although user agents may render them in other ways (e.g., as navigation tools).
Tests: None

Assertion 12.1.3-1

Reference: Section 12.1.3
(may) The retrieved resource may be handled by the user agent in several ways: by opening a new HTML document in the same user agent window, opening a new HTML document in a different window, starting a new program to handle the resource, etc.
Tests: None

Assertion 12.1.3-2

Reference: Section 12.1.3
(may) Since the A element has content (text, images, etc.), user agents may render this content in such a way as to indicate the presence of a link (e.g., by underlining the content
Tests: None

Assertion 12.1.3-3

Reference: Section 12.1.3
(informative) When the name or id attributes of the A element are set, the element defines an anchor that may be the destination of other links.
Tests: None

Assertion 12.1.3-4

Reference: Section 12.1.3
(author)(may) Authors may set the name and href attributes simultaneously in the same A instance.
Tests: None

Assertion 12.1.3-5

Reference: Section 12.1.3
(informative) The LINK element defines a relationship between the current document and another resource.
Tests: None

Assertion 12.1.4-1

Reference: Section 12.1.4
(may) The title attribute may be set for both A and LINK to add information about the nature of a link.
Tests: None

Assertion 12.1.5-1

Reference: Section 12.1.5
(should) The charset attribute allows authors to advise user agents about the encoding of data at the other end of the link.
Tests: None

Assertion 12.1.5-2

Reference: Section 12.1.5
(should) The hreflang attribute provides user agents with information about the language of a resource at the end of a link, just as the lang attribute provides information about the language of an element's content or attribute values.
Tests: None

Assertion 12.1.5-3

Reference: Section 12.1.5
(informative) User agents may either locate resources necessary for the correct presentation of the document or, if they cannot locate the resources, they should at least warn the user that the document will be unreadable and explain the cause.
Tests: None

Assertion 12.2-1

Reference: Section 12.2
(author)(must) A: The start tag and end tag are required.
Tests: None

Assertion 12.2-2

Reference: Section 12.2
(must) A: name = cdata [CS] This attribute names the current anchor so that it may be the destination of another link. The value of this attribute must be a unique anchor name. The scope of this name is the current document. Note that this attribute shares the same name space as the id attribute. (See assertion 12.1-10, 12.1-11)
Tests: None

Assertion 12.2-3

Reference: Section 12.2
(must) A: href = uri [CT] This attribute specifies the location of a Web resource, thus defining a link between the current element (the source anchor) and the destination anchor defined by this attribute. (See assertion 12.1.3-3, 12.1.3- 4)
Tests: None

Assertion 12.2-4

Reference: Section 12.2
(must) A: hreflang = langcode [CI] This attribute specifies the base language of the resource designated by href and may only be used when href is specified. (See assertion 12.1.5-2)
Tests: None

Assertion 12.2-5

Reference: Section 12.2
(must) A: type = content-type [CI] This attribute gives an advisory hint as to the content type of the content available at the link target address. It allows user agents to opt to use a fallback mechanism rather than fetch the content if they are advised that they will get content in a content type they do not support. Authors who use this attribute take responsibility to manage the risk that it may become inconsistent with the content available at the link target address.
Tests: None

Assertion 12.2-6

Reference: Section 12.2
(must) A: rel = link-types [CI] This attribute describes the relationship from the current document to the anchor specified by the href attribute. The value of this attribute is a space-separated list of link types. (See assertion 12.1.2-1)
Tests: None

Assertion 12.2-7

Reference: Section 12.2
(must) A: rev = link-types [CI] This attribute is used to describe a reverse link from the anchor specified by the href attribute to the current document. The value of this attribute is a space-separated list of link types. (See assertion 12.1.2-1)
Tests: None

Assertion 12.2-8

Reference: Section 12.2
(must) A: charset = charset [CI] This attribute specifies the character encoding of the resource designated by the link. Please consult the section on character encodings for more details. (See assertion 12.1.5-1)
Tests: None

Assertion 12.2-9

Reference: Section 12.2
(should) The A element's content defines the position of the anchor.
Tests: None

Assertion 12.2-10

Reference: Section 12.2
(should) The name attribute names the anchor so that it may be the destination of zero or more links (see also anchors with id).
Tests: None

Assertion 12.2-11

Reference: Section 12.2
(should) The href attribute makes this anchor the source anchor of exactly one link.
Tests: None

Assertion 12.2-12

Reference: Section 12.2
(author)(may) Authors may also create an A element that specifies no anchors, i.e., that doesn't specify href, name, or id. Values for these attributes may be set at a later time through scripts.
Tests: None

Assertion 12.2-13

Reference: Section 12.2
(should) User agents generally render links in such a way as to make them obvious to users (underlining, reverse video, etc.). The exact rendering depends on the user agent. Rendering may vary according to whether the user has already visited the link or not.
Tests: None

Assertion 12.2.1-1

Reference: Section 12.2.1
(must) An anchor name is the value of either the name or id attribute when used in the context of anchors.
Tests: None

Assertion 12.2.1-2

Reference: Section 12.2.1
(author)(must) Uniqueness: Anchor names must be unique within a document. Anchor names that differ only in case may not appear in the same document.
Tests: None

Assertion 12.2.1-3

Reference: Section 12.2.1
(must) String matching: Comparisons between fragment identifiers and anchor names must be done by exact (case-sensitive) match.
Tests: None

Assertion 12.2.2-1

Reference: Section 12.2.2
(must) Links and anchors defined by the A element must not be nested
Tests: None

Assertion 12.2.3-1

Reference: Section 12.2.3
(may) The id attribute may be used to create an anchor at the start tag of any element (including the A element).
Tests: None

Assertion 12.2.3-2

Reference: Section 12.2.3
(author)(must) The id and name attributes share the same name space. This means that they cannot both define an anchor with the same name in the same document.
Tests: None

Assertion 12.2.3-3

Reference: Section 12.2.3
(may) It is permissible to use the id and name attributes to specify an element's unique identifier for the following elements: A, APPLET, FORM, FRAME, IFRAME, IMG, and MAP.
Tests: None

Assertion 12.2.3-4

Reference: Section 12.2.3
(author)(must) When the id and name attributes are used on a single element, their values must be identical.
Tests: None

Assertion 12.2.3-5

Reference: Section 12.2.3
(may) The name attribute may contain character references (See assertion 12.1.1-4)
Tests: None

Assertion 12.2.3-6

Reference: Section 12.2.3
(author)(must) The id attribute, on the other hand, may not contain character references. (See assertion 12.1.1-4)
Tests: None

Assertion 12.2.3-7

Reference: Section 12.2.3
(author)(informative) Authors should consider the following issues when deciding whether to use id or name for an anchor name: 1. The id attribute can act as more than just an anchor name (e.g., style sheet selector, processing identifier, etc.). 2. Some older user agents don't support anchors created with the id attribute. 3. The name attribute allows richer anchor names (with entities).
Tests: None

Assertion 12.2.4-1

Reference: Section 12.2.4
(should) A reference to an unavailable or unidentifiable resource is an error. Although user agents may vary in how they handle such an error, we recommend the following behavior: 1. If a user agent cannot locate a linked resource, it should alert the user. 2. If a user agent cannot identify the type of a linked resource, it should still attempt to process it. It should alert the user and may allow the user to intervene and identify the document type.
Tests: None

Assertion 12.3-1

Reference: Section 12.3
(author)(must) LINK: The start tag is required and the end tag is forbidden.
Tests: None

Assertion 12.3-2

Reference: Section 12.3
(may) Although LINK has no content, it conveys relationship information that may be rendered by user agents in a variety of ways (e.g., a tool-bar with a drop-down menu of links).
Tests: None

Assertion 12.3.1-1

Reference: Section 12.3.1
(should) The rel and rev attributes play complementary roles -- the rel attribute specifies a forward link and the rev attribute specifies a reverse link.
Tests: None

Assertion 12.3.2-1

Reference: Section 12.3.2
(should) When the LINK element links an external style sheet to a document, the type attribute specifies the style sheet language and the media attribute specifies the intended rendering medium or media.
Tests: None

Assertion 12.3.3-1

Reference: Section 12.3.3
(author)(may) Authors may use the LINK element to provide a variety of information to search engines, including: 1. Links to alternate versions of a document, written in another human language. 2. Links to alternate versions of a document, designed for different media, for instance a version especially suited for printing. 3. Links to the starting page of a collection of documents.
Tests: None

Assertion 12.4-1

Reference: Section 12.4
(author)(must) BASE: The start tag is required and the end tag is forbidden.
Tests: None

Assertion 12.4-2

Reference: Section 12.4
(must) BASE: href = uri [CT] This attribute specifies an absolute URI that acts as the base URI for resolving relative URIs.
Tests: None

Assertion 12.4-3

Reference: Section 12.4
(author)(must) In HTML, links and references to external images, applets, form-processing programs, style sheets, etc. are always specified by a URI.
Tests: None

Assertion 12.4-4

Reference: Section 12.4
(must) Relative URIs are resolved according to a base URI, which may come from a variety of sources
Tests: None

Assertion 12.4-5

Reference: Section 12.4
(must) The BASE element allows authors to specify a document's base URI explicitly.
Tests: None

Assertion 12.4-6

Reference: Section 12.4
(must) When present, the BASE element must appear in the HEAD section of an HTML document, before any element that refers to an external source. The path information specified by the BASE element only affects URIs in the document where the element appears.
Tests: None

Assertion 12.4.1-1

Reference: Section 12.4.1
(must) User agents must calculate the base URI according to the following precedences (highest priority to lowest): 1. The base URI is set by the BASE element. 2. The base URI is given by meta data discovered during a protocol interaction, such as an HTTP header (see [RFC2616]). 3. By default, the base URI is that of the current document. Not all HTML documents have a base URI (e.g., a valid HTML document may appear in an email and may not be designated by a URI). Such HTML documents are considered erroneous if they contain relative URIs and rely on a default base URI.
Tests: None