W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2010

[whatwg] Why children of datalist elements are barred from constraint validation?

From: Mounir Lamouri <mounir.lamouri@gmail.com>
Date: Fri, 31 Dec 2010 11:01:59 +0100
Message-ID: <4D1DAA17.2020808@gmail.com>
On 12/31/2010 03:20 AM, Ian Hickson wrote:
> On Fri, 24 Sep 2010, Mounir Lamouri wrote:
>> I agree that a child of a datalist element should not block the form 
>> submission. However, I'm wondering why do we care about this particular 
>> edge case when there are a lot of situations where an element can be 
>> invalid without any possible action from the user.
>> If there is no specific use cases in mind I think we should just remove 
>> that.
> It's so that you can use a <select> in the <datalist> (with the same 
> <option>s) for fallback in older UAs, without that <select> having any 
> effect on the form submission.

I do not understand that the <select> inside the <datalist> should not
be invalid but why it *has* to be barred from constraint validation?
Adding the required attribute to the select element in that case would
be stupid and useless. The other way to make the <select> element
invalid would be by calling .setCustomValidity(). Is there a real use
case that require calling .setCustomValidity() in batch? Even if, can't
we rely on the authors not calling .setCustomValidity() on elements that
should not be invalid? We already do that for non-displayed elements,
don't we?

You should take into account that this requirement force the UA to check
the entire parent tree to prevent a situation that can happen in various
other ways.

Received on Friday, 31 December 2010 02:01:59 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:29 UTC