[whatwg] Significant inline content vs. attributes and sectional elements
hsivonen at iki.fi
Thu Mar 9 13:32:13 PST 2006
It seems to me that the WA 1.0 spec presents requirements on document
conformance that are very different from each other in spirit in a
seemingly arbitrary way.
On one hand, some elements are required to have significant inline
content or are barred from having traditional flow content while, on
the other hand, the requirements on attribute occurrence are very lax
and sectional elements are not required to have any content at all.
These requirements seem very inconsistent in spirit to me.
Obviously, a browser won't catch fire and the sky won't fall if a
link element does not have an href attribute and a rel attribute or
if a blockquote is empty. However, the consequences of having both
inline and block content in list items or lacking significant inline
content in paragraphs won't make the sky fall and the browser catch
fire, either. Yet, a link element that lacks the href and rel
attributes the doesn't make any sense. Sure, a script could add those
attributes, but then it could add the entire element while at it or
it could add significant inline content to a paragraph.
To make document conformance a more useful concept for the purpose of
catching author errors, I suggest that the following attributes be
href and rel on link
href on base
name and content on meta (other than the encoding decl)
src on img
code, height and width on applet
name and value on param
To allow user agents see whether the author provided the empty string
as the alternative text of whether the author just didn't care, I
suggest that the alt attribute on img be made optional. The above-
mentioned elements are useless without the listed attributes. The img
element is not useless without alt, so editors have an incentive to
allow authors to insert img elements without alternative text but do
not have an incentive to allow useless link elements, for example.
Since sectional elements are document-oriented rather than Web
application-oriented, it seems to me it would make sense to require
them to contain one or more block elements as opposed to zero or more.
On the other hand, I have doubts about the requirement of significant
inline content. When the W3C said that paragraphs mustn't be empty,
various applications started emitting <p> </p>. If the WHAT WG
says that paragraphs must contend significant inline content, are the
developers of those applications suddenly going to decide not to
allow them to paragraphs to be saved or are they going to come up
with an even more crufty work-around to comply with the machine-
checkable requirements of the spec?
hsivonen at iki.fi
More information about the whatwg