[whatwg] Selectors Tests and :enabled

fantasai fantasai.lists at inkedblade.net
Wed Feb 11 14:43:08 PST 2009


Ian Hickson wrote in http://lists.w3.org/Archives/Public/www-style/2009Feb/0328.html :
> On Wed, 29 Oct 2008, Lachlan Hunt wrote:
>> fantasai wrote:
>>> Lachlan Hunt wrote:
>>>> http://lachy.id.au/dev/css/tests/selectors/pseudo-classes/ui/
>>> Interesting. I'm not convinced that :enabled and :disabled shouldn't match
>>> <input type="hidden">. Konqueror and Mozilla both make them match, so I'd
>>> like to check with the CSSWG if that's really the interpretation we want
>>> before deciding whether to accept your tests. 
>> Opera currently also makes them match, but WebKit doesn't.  However, the
>> Selectors spec states that:
>>
>>   Most elements will be neither enabled nor disabled. An element is
>>   enabled if the user can either activate it or transfer the focus to
>>   it. An element is disabled if it could be enabled, but the user cannot
>>   presently activate it or transfer focus to it.
>>
>> Since a hidden input cannot be activated or have focus transferred to it, my
>> understanding is that they shouldn't match, which makes WebKit's behaviour
>> correct, and Opera, Firefox and Konqueror all incorrect.  But if the intention
>> is for these pseudo classes to match hidden inputs, then please fix the spec.
>>
>>> AFAICT WF2 requires them to match, but Selectors' wording implies that they
>>> don't.
>> The Web Forms 2 spec is obsolete now that forms have been integrated into
>> HTML5.
> 
> HTML5 now says :enabled never matches type=hidden. (And :disabled doesn't 
> either, since you can't disable an <input type=hidden>.)

Given the state of current implementations and the fact that hidden input
elements do have distinct enabled and disabled states, I don't understand
the reasoning behind this change.
   http://twitter.com/WHATWG/status/1198455588

On a related note, the HTML5 spec currently defines :enabled to match
<a>, <area>, and <link> elements, as well as any other elements that are
focusable--conflicting with the Selectors spec, which defines :enabled
to only apply to elements that have a corresponding disabled state.
   http://dev.w3.org/csswg/selectors3/#UIstates
http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#matching-html-elements-using-selectors

One of these specs needs to change. If you think it should be Selectors,
please explain your reasoning and why you believe it is important enough
to force implementations conforming to the Selectors definition of
:enabled (of which we have at least three) to change.

~fantasai



More information about the whatwg mailing list