W3C home > Mailing lists > Public > www-validator-cvs@w3.org > April 2015

[Bug 28428] OPTION element in DATALIST element can be empty, but validator say no

From: <bugzilla@jessica.w3.org>
Date: Fri, 10 Apr 2015 17:20:06 +0000
To: www-validator-cvs@w3.org
Message-ID: <bug-28428-169-PDYuwGsNAR@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28428

--- Comment #3 from Michael[tm] Smith <mike@w3.org> ---
(In reply to Michael Benjamin from comment #2)
> Thank you for the response. However, I'm not sure what you're saying is
> correct.

I am sure that what I'm saying is correct.

> First, the language in the spec doesn't seem clear or definitive.

The language in the spec absolutely is definitive. The spec states normative
requirements that must be followed. Nothing else stated informatively anywhere
else can override normative requirements stated in the spec.

As to whether the spec is clear or not, it's possible for there to be some
particular place where the spec may not be clear some some particular thing.
The way to fix that is to raise a bug suggesting how that place in the spec
could be made more clear.

But in the particular case of the option content model, it doesn't seem to me
that the spec is unclear. The relevant  statement the spec makes about the
option content model is, "If the element has no label attribute: Text that is
not inter-element whitespace".

If there's some way that you think that could be improved to state the
requirement more clearly, please file a bug against the HTML spec with your
suggested improvement. 

> Second, and more importantly, all examples and tutorials from reputable
> sources (including W3C) use OPTION in DATALIST without the LABEL attribute.

Any examples that have empty option elements without labels are invalid
according to the current HTML spec. The way to fix that mismatch is either to
(A) file a bug against the HTML spec asking that spec be changed to say, e.g.,
that an empty option element without a label is allowed to occur in datalist,
or to (B) file bugs or reports of some kind against whatever documents those
invalid examples are in.

> Of course, I am open to the possibility that despite all these examples, I
> am still wrong. If so, please advise the correct way to write the code in
> the pages above.

Either put label attributes on all the empty option elements, or put text
content inside the option elements so they're no longer empty.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 10 April 2015 17:20:08 UTC

This archive was generated by hypermail 2.3.1 : Friday, 10 April 2015 17:20:08 UTC