[Bug 24801] <option> content model

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24801

Michael[tm] Smith <mike@w3.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |mike@w3.org
         Resolution|---                         |WORKSFORME

--- Comment #1 from Michael[tm] Smith <mike@w3.org> ---
(In reply to Andrea Rendine from comment #0)
>        <option label="Opel" value="opel"></option>
>        <option label="Audi" value="audi" />
...
> The response from the validator is error. More precisely
> Self-closing syntax (/>) used on a non-void HTML element. Ignoring the slash
> and treating as a start tag.

Yeah, conforms to the spec.

...
> In fact when validating the same document as XHTML, the validator flags
> nothing.

Right. That's because in XML, <option label="Audi" value="audi" /> is exactly
the same thing as <option label="Audi" value="audi" ></option> -- because in
XML there is actually something called a "self-closing" tag.

But in text/html, <option label="Audi" value="audi" /> is not the same thing as
<option label="Audi" value="audi" ></option> at all -- because in text/html
there is no such thing as a "self-closing" tag.

In other words, in text/html that slash in the start tag has no meaning at all
and no effect at all.

> If the problem is in using the self-closing syntax in a non-void
> element,

No, because there's no such thing as "self-closing syntax" in text/html. The
slash is irrelevant. The only problem is that the <option> element is not a
void element, and per the spec in text/html it must have an end tag. But it
does not have an end tag in your document. Hence the error.

> then the element is non-void as both HTML and XHTML

There is no such thing as a void element in XML. The term "void element" is
something specific to text/html>

> (the validation
> for the latter does not take into account only well-formedness) and XHTML
> validation must report it accordingly.

No it must not, because there's no error to report. To an XML parser, <option
label="Audi" value="audi" /> is exactly the same thing as <option label="Audi"
value="audi" ></option>.

> If, on the contrary, there's a bug in the validator not recognizing the void
> element, then it's HTML validator which must be corrected.

There's no bug in the validator for this case. The validator behavior here
conforms to the spec.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 26 February 2014 20:44:34 UTC