[whatwg] fieldset disabled and first legend

Jonas Sicking jonas at sicking.cc
Tue Sep 21 01:06:44 PDT 2010


On Mon, Sep 20, 2010 at 11:26 PM, Mounir Lamouri
<mounir.lamouri at gmail.com> wrote:
> Hi,
>
> The current specification for the fieldset element's disabled attribute
> is the following:
> "The disabled  attribute, when specified, causes all the form control
> descendants of the fieldset element, excluding those that are
> descendants of the fieldset element's first legend element child, if
> any, to be disabled."
>
> First of all, "form control descendants" isn't really clear considering
> there is no real definition of "form control" in the specification
> AFAIK. Why not using "listed elements" instead? which would correspond
> to all elements returned by .elements.
>
> This is very interesting to have the elements inside the first legend to
> not be disabled. I guess the idea is to have a checkbox enabling some
> options. For example, "advanced options" in a configuration.
> However, the specification seems to miss one edge case. What if a
> fieldset has been disabled because it is inside a disabled fieldset?
> Depending on how you read the current specification, you can consider
> that the elements inside the first legend of the second fieldset should
> be disabled or not. My opinion is, those elements should be disabled and
> that's the current Gecko's behavior (current nightly and next beta).
> It would be good to add something mentioning this edge case.

This is arguably already defined. Consider the case of:

<fieldset disabled>
  <fieldset>
    <legend><input type=checkbox></legend>
  </fieldset>
</fieldset>

In this case the <input> is inside the *outer* fieldset, but not
inside *its* first <legend> (since it doesn't have one). Thus it
should be disabled.

/ Jonas



More information about the whatwg mailing list