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

[whatwg] The form attribute (Association of controls and forms)

From: Mounir Lamouri <mounir.lamouri@gmail.com>
Date: Fri, 14 May 2010 02:53:36 +0200
Message-ID: <4BEC9F10.3060300@gmail.com>
Hi,

"4.10.18 Association of controls and forms" explains the link between
forms and form-associated elements (and the form attribute). However,
I've the feeling the specifications go far over what should be done and
force the implementor how to do it.
What I mean is, this could be summarized like this: "If the form
attribute is specified, the form owner of the element is the first form
in the Document with the id corresponding of the form attribute value,
if any. If the form attribute content is not a form element id, the
element has no form owner. If the form attribute isn't specificed, the
element form owner is the nearest ancestor form."

However, the specification say (not only):
"When a form-associated element's ancestor chain changes, e.g. because
it or one of its ancestors was inserted or removed from a Document, then
the user agent must reset the form owner of that element.

When a form-associated element's form attribute is added, removed, or
has its value changed, then the user agent must reset the form owner of
that element.

When a form-associated element has a form attribute and the ID of any of
the elements in the Document changes, then the user agent must reset the
form owner of that form-associated element.

When a form-associated element has a form attribute and an element with
an ID is inserted into or removed from the Document, then the user agent
must reset the form owner of that form-associated element."

These sentences explain more than "what should be the form owner" but
explain how to implement it. It seems useless and maybe not needed
sometimes (I'm wondering if checking for the ID wouldn't be better than
observing all the element's ID change and insertion/removal).

In my opinion, the form attribute behaves more or less like the for
attribute for the label element so I'm wondering why the specification
is so different. Is there a reason I'm missing ?

Thanks,
--
Mounir
Received on Thursday, 13 May 2010 17:53:36 UTC

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