Re: :required validation in CSS3

Isn't the main difference between a given attribute selector and its
equivalent pseudo-class that the attribute selector only matches the
attribute but a pseudo-class can be dynamic (e.g. respond to a property
change or other change in state)? An example would be "p:lang(en)", which
will match the "computed language" (for lack of a better term) of paragraph
elements whereas "p[lang|=en]" will only match the attribute on the
paragraph elements themselves. Fortunately, JavaScript can be used to
simulate most pseudo-classes, either by calling "setAttribute()" or by
adding/removing a class to/from the element.


On Wed, Jun 15, 2016 at 4:06 PM, Jukka K. Korpela <jkorpela@cs.tut.fi>
wrote:

> 15.6.2016, 1:38, Benedicte Roussel wrote:
>
> I have used :required in a HTLM5 form<label for="mail">Votre mail :
>> </label><input type="email" name="mail" id="mail" required/>. It was
>> understood by the navigators but in the validator instead of writing the
>> following in my CSS3:
>>
>> *:required*
>>
> – –
>
>> *I had to write the following in order that my CSS (level3) be validated..*
>>
>>
>> *[required]*
>>
>
> I’m afraid there isn’t any definite published description of exactly what
> the CSS Validator is checking against. But it seems that (possibly with
> some exceptions) it recognizes W3C CSS specifications with maturity level
> CR (Candidate Recommendation) or higher.
>
> And as far as I can see, :required is not defined in such documents.
> “Selectors Level 4” mentions it, but it’s just a Working Draft and has not
> made much progress (the newest Working Draft is dated 2 May 2013).
>
> *Could we expect that :required be validated by CSS3 validator in a very
>> near future ? Or am I dreaming about it ?*
>>
>
> I wouldn’t expect so. But why would that matter?
>
> There is the simple workaround you mention, using the attribute selector
> [required]. (I wonder whether :required offers any particular benefit over
> it.)
>
> Yucca
>
>
>
>

Received on Wednesday, 15 June 2016 20:52:20 UTC