Re: :required validation in CSS3

Kravvitz <[email protected]> Wed, 15 Jun 2016 16:49:57 -0400
Newsgroups gmane.org.w3c.validator.css
Message-ID <CAO1Uge=8+NHceB0D26CNNhfmn0+dXnVqxGp9E-c0d=UCmgHJmw@mail.gmail.com>
--001a113d2b98dcff3405355744e7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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|=3Den]" 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 <[email protected]>
wrote:

> 15.6.2016, 1:38, Benedicte Roussel wrote:
>
> I have used :required in a HTLM5 form<label for=3D"mail">Votre mail :
>> </label><input type=3D"email" name=3D"mail" id=3D"mail" required/>. It w=
as
>> understood by the navigators but in the validator instead of writing the
>> following in my CSS3:
>>
>> *:required*
>>
> =E2=80=93 =E2=80=93
>
>> *I had to write the following in order that my CSS (level3) be validated=
..*
>>
>>
>> *[required]*
>>
>
> I=E2=80=99m afraid there isn=E2=80=99t 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.
> =E2=80=9CSelectors Level 4=E2=80=9D mentions it, but it=E2=80=99s 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=E2=80=99t 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 ove=
r
> it.)
>
> Yucca
>
>
>
>

--001a113d2b98dcff3405355744e7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Isn&#39;t the main difference between a given attribu=
te selector and its equivalent pseudo-class that the attribute selector onl=
y 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 &quot;p:la=
ng(en)&quot;, which will match the &quot;computed language&quot; (for lack =
of a better term) of paragraph elements whereas &quot;p[lang|=3Den]&quot; w=
ill only match the attribute on the paragraph elements themselves. Fortunat=
ely, JavaScript can be used to simulate most pseudo-classes, either by call=
ing &quot;setAttribute()&quot; or by adding/removing a class to/from the el=
ement.<br><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmai=
l_quote">On Wed, Jun 15, 2016 at 4:06 PM, Jukka K. Korpela <span dir=3D"ltr=
">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
ut.fi</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=
=3D"">15.6.2016, 1:38, Benedicte Roussel wrote:<br>
<br>
</span><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex"><span class=3D"">
I have used :required in a HTLM5 form&lt;label for=3D&quot;mail&quot;&gt;Vo=
tre mail :<br>
&lt;/label&gt;&lt;input type=3D&quot;email&quot; name=3D&quot;mail&quot; id=
=3D&quot;mail&quot; required/&gt;. It was<br>
understood by the navigators but in the validator instead of writing the<br=
>
following in my CSS3:<br>
<br></span>
*:required*<br>
</blockquote>
=E2=80=93 =E2=80=93<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
*I had to write the following in order that my CSS (level3) be validated.*<=
br>
<br>
<br>
*[required]*<br>
</blockquote>
<br>
I=E2=80=99m afraid there isn=E2=80=99t any definite published description o=
f exactly what the CSS Validator is checking against. But it seems that (po=
ssibly with some exceptions) it recognizes W3C CSS specifications with matu=
rity level CR (Candidate Recommendation) or higher.<br>
<br>
And as far as I can see, :required is not defined in such documents.<br>
=E2=80=9CSelectors Level 4=E2=80=9D mentions it, but it=E2=80=99s just a Wo=
rking Draft and has not made much progress (the newest Working Draft is dat=
ed 2 May 2013).<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
*Could we expect that :required be validated by CSS3 validator in a very<br=
>
near future ? Or am I dreaming about it ?*<br>
</blockquote>
<br>
I wouldn=E2=80=99t expect so. But why would that matter?<br>
<br>
There is the simple workaround you mention, using the attribute selector [r=
equired]. (I wonder whether :required offers any particular benefit over it=
..)<br>
<br>
Yucca<br>
<br>
<br>
<br>
</blockquote></div><br></div>

--001a113d2b98dcff3405355744e7--