Re: [selectors-4] :blank

On 11/22/18 2:14 PM, Andrew Fedoniouk wrote:
>> > :blank is quite bad as a state name
>  >> For example <input type="text" value="">  shall be considered as not :blank as it has initial value
>  >> deliberately set to blank string (empty string allowed).
> 
>  >No, actually, that would also match :blank.
>  >:blank is not intended as :user-modified or anything like that, it's a check
>  >on the current state of the value.
> 
> It has quite limited practical use then. Yet not clear what it means in case of <select>, 
> <input|radio> and others.

In the case of <select> it seems reasonably clear; but you're right that
<input|radio> would likely need clarification. I'll file an issue...
   https://github.com/w3c/csswg-drafts/issues/3339

> I would expect  <input type="text" value="">  to match input:empty  selector if I just want to check 
> if it is *empty*.

:empty is defined to check the contents of the element, so <input> (like <img>) is always empty.

> Why do we need that separate :blank selector that can be used only with particular <input type=text> 
> element?

See above: we can't use :empty because it doesn't check the value, it checks the contents. We need 
something that checks the value.

> Anyway what would be the selector for unsuccessful (for form submission)  elements?

Blank inputs are successfully submitted, unless they're disabled.
So I'm not sure what you're looking for here.

> How we will be able to highlight form elements that are not set / not ready for submission?

Depends on what you mean by “not ready for submission”.
There exists the :valid/:invalid selector pair, for example.

> Distinct styling of “no-value yet” state  is used on almost any form on the web these days.

Yes, and :blank can be part of that.

FWIW here's the discussion which prompted the addition of :blank for inputs:
   https://github.com/w3c/csswg-drafts/issues/1283

~fantasai

Received on Friday, 23 November 2018 19:43:00 UTC