Re: [whatwg] Markup-related feedback

On 10/27/14, Ian Hickson <ian@hixie.ch> wrote:
>
> On Fri, 24 Jan 2014, Jukka K. Korpela wrote:
>> 2014-01-22 2:28, Ian Hickson wrote:
>> > On Tue, 3 Dec 2013, Jukka K. Korpela wrote:
>> > >

[...]

>> 3.  To determine if a form control is eligible for success (see below)
>> `HTMLFormControl.isEnabled`
>
> What's the use case?
>
> Would an unchecked checkbox be considered "eligible" by this criteria?
>

That's irrelevant. Successful form controls, as defied in HTML4.


[...]
>
>
>> Disabling a fieldset disables its descendant controls but does not
>> change their disabled property. Thus, a disabled fieldset's descendant
>> controls won't succeed, however, its descendant controls' `disabled`
>> property can be true.
>
> Yeah, the "disabled" property just reflects the disabled="" attribute.
>
>
>> From what I understand, the word "disabled" it appears in HTML5 is
>> overloaded to describe the following three different things:
>>
>> 1)      The form control's disabled `property` *
>
> The spec prefers the term IDL attribute, but yes.
>
>> 2)      The form control's disabled attribute (content attribute) **
>>
>> 3)      The form control's eligibility for success. ***
>
> Right.
>
>
>> I propose changing one of these -- the last -- to the positive sense --
>> isEnabled, and exposing that in the DOM. Because it's not so useful to
>> have a form whose disabled property is false but the form is "disabled"
>> due to being a descendant of a disabled fieldset.
>
> What's the use case?
>

Need to know if a form control is enabled (and if it is, get its value).


> Is it common enough that it's worth having a convenience API for it? (You
> can always write a function to determine the state.)
>

Yes, it is very common. And it used to be as simple as:-

 element.disabled

- but now that FIELDSET can be disabled, descendent elements are
ineligible for success, yet `element.disabled` is true. A confounding
yet glaring detail.

It is not so common to disable a FIELDSET because:-

1) It is not widely supported.
2) it is not a commonly needed feature.

But when it is needed,  `fieldset.disabled`  is simpler than looping
through its descendant controls manually and setting their respective
`disabled` property.

But it also means any code that wants to determine if a form control
is eligible for success -- and that control is not disabled -- must
traverse up the document tree to see if that control is not within a
FIELDSET that is disabled. Right?

Instead, the code should be able to determine if the control is
eligible for success, and this should be possible with a property
check. Like isEnabled.

To be feature complete, disable-ability of FIELDSET requires a simple
way to determine if an element is eligible/enabled -- like
element.isEnabled.
-- 
Garrett
@xkit
ChordCycles.com
garretts.github.io

Received on Tuesday, 30 December 2014 06:24:49 UTC