Errors involving content with dubious semanticsTo avoid misuse of elements with defined meanings, content models are defined that restrict
how elements can be nested when such nestings would be of dubious value.
For example, this specification disallows nesting aErrors that involve a conflict in expressed semanticsSimilarly, to draw the author's attention to mistakes in the use of elements, clear
contradictions in the semantics expressed are also considered conformance errors.
In the fragments below, for example, the semantics are nonsensical: a separator cannot
simultaneously be a cell, nor can a radio button be a progress bar.
Another example is the restrictions on the content models of theCases where the default styles are likely to lead to confusionCertain elements have default styles or behaviors that make certain combinations likely to
lead to confusion. Where these have equivalent alternatives without this problem, the confusing
combinations are disallowed.
For example, block boxes, and inline boxes. Putting a block box in an
inline box is unnecessarily confusing; since either nesting just block box in
an inline box, the latter combination is disallowed.
Another example would be the way interactive content cannot be
nested. For example, aErrors that indicate a likely misunderstanding of the specificationSometimes, something is disallowed because allowing it would likely cause author
confusion.
For example, setting the false" is disallowed, because despite the
appearance of meaning that the element is enabled, it in fact means that the element is
disabled (what matters for implementations is the presence of the attribute, not its
value).Errors involving limits that have been imposed merely to simplify the languageSome conformance errors simplify the language that authors need to learn.
For example, theErrors that involve peculiarities of the parserCertain elements are parsed in somewhat eccentric ways (typically for historical reasons),
and their content model restrictions are intended to avoid exposing the author to these
issues.
For example, a phrasing content,
because when parsed as HTML, a paragraphs, not one:
Welcome.
Name:It is parsed exactly like the following:
Welcome.
Name: Errors that would likely result in scripts failing in hard-to-debug waysSome errors are intended to help prevent script problems that would be hard to debug.This is why, for instance, it is non-conforming to have twoErrors that waste authoring timeSome constructs are disallowed because historically they have been the cause of a lot of
wasted authoring time, and by encouraging authors to avoid making them, authors can save time in
future efforts.
For example, aErrors that involve areas that affect authors migrating between the HTML and XML
syntaxesSome authors like to write files that can be interpreted as both XML and HTML with similar
results. Though this practice is discouraged in general due to the myriad of subtle
complications involved (especially when involving scripting, styling, or any kind of automated
serialization), this specification has a few restrictions intended to at least somewhat mitigate
the difficulties. This makes it easier for authors to use this as a transitionary step when
migrating between the HTML and XML syntaxes.
For example, there are somewhat complicated rules surrounding the
Another example would be the restrictions on the values of xmlns attributes in the HTML serialization, which are intended to ensure that
elements in conforming documents end up in the same namespaces whether processed as HTML or
XML.Errors that involve areas reserved for future expansionAs with the restrictions on the syntax intended to allow for new syntax in future revisions
of the language, some restrictions on the content models of elements and values of attributes
are intended to allow for future expansion of the HTML vocabulary.
For example, limiting the values of theErrors that indicate a mis-use of other specificationsCertain restrictions are intended to support the restrictions made by other
specifications.
For example, requiring that attributes that take media query lists use only
valid media query lists reinforces the importance of following the conformance rules of
that specification.