[whatwg] [wf2] Omission of legend

Henri Sivonen hsivonen at iki.fi
Sat Apr 1 04:51:14 PST 2006

I hit this issue at:

The spec says:
"Specifically, the form, legend, select, and optgroup elements may  
now be empty. - - In HTML4, those elements always required at least  
one element child, or, in the case of legend, at least one character  
of text."

The position of HTML 4.01 was pretty clearly that <legend> is  
required as the first child (ignoring whitespace) of <fieldset>.  
However, SGML DTDs are not expressive enough to enforce the part of  
forbidding non-whitespace character data before <legend>.

XML DTDs are even less expressive, so the XHTML 1.0 Strict DTD  
neither enforces the presence of <legend> nor its position as the  
first child.

Since the omission of <legend> does not cause any horrible effects, I  
suggest making <legend> optional and reaffirming that if it appears,  
it can appear only once per <fieldset> and only as the first child  
(ignoring whitespace).

Henri Sivonen
hsivonen at iki.fi

More information about the whatwg mailing list