[whatwg] Form validation against invisible controls

Aryeh Gregor Simetrical+w3c at gmail.com
Thu Jun 3 15:48:41 PDT 2010


On Thu, Jun 3, 2010 at 12:11 PM, TAMURA, Kent <tkent at chromium.org> wrote:
> Oh, I'm sorry.  I have found a sentence about visibility in the draft.
> http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#constraint-validation
>> If one of the controls is not being rendered (e.g. it has
>> the hidden attribute set) then user agents may report a script error.
>
> This sentence is about process against controls of which validation result
> is invalid.
> I think UA doesn't need to validate such controls.
>
> The Chrome bug report is
> here: http://code.google.com/p/chromium/issues/detail?id=45640

I think this isn't a feasible strategy to pursue.  You'd have to
carefully define what's "not being rendered", and it will violate
layering massively.  CSS should not be able to override constraints
set in HTML.  The latter are part of the semantics of the form, and
the former is supposed to only control presentation.

If the user can't actually change the form to match requirements,
that's a bug in the page.  The browser should not try to guess what
the page really meant using some inevitably complicated heuristic.  It
should respect what the page says, and make it not work.  If the
browser has a UI for form validation errors, it can use that to tell
the user what the problem is in terms that the page author can
understand, so the user can report it and the page can be fixed.



More information about the whatwg mailing list