attr(<identifier>)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

attr(<identifier>)

Jens Oliver Meiert
(CC www-style for spec may be ambiguous)

The CSS validator throws parse errors for constructs like

a[href^='http']:after {
  content: ' <' attr(href) '>';
}

(Same for “content: ' \003C' attr(href) '\003E';”—both should work
from what I can tell.)

Two of the relevant documents I checked [1,2] seem blissfully unclear
about concatenation, however it appears (per samples like “string-set:
author attr(author);”) that this is, indeed, valid CSS.
Implementations (WebKit) support that notion, for the code is
supported.

Unless I’m missing something, can the validator team look into this,
and the CSS working group clarify if necessary?

Cheers,
 Jens.


[1] http://www.w3.org/TR/CSS21/generate.html
[2] http://www.w3.org/TR/css3-content/

--
Jens Oliver Meiert
http://meiert.com/en/

✎ The Little Book of HTML/CSS Frameworks: http://meiert.com/frameworks

Reply | Threaded
Open this post in threaded view
|

Re: attr(<identifier>)

Tab Atkins Jr.
On Mon, Sep 21, 2015 at 11:48 AM, Jens Oliver Meiert <[hidden email]> wrote:

> (CC www-style for spec may be ambiguous)
>
> The CSS validator throws parse errors for constructs like
>
> a[href^='http']:after {
>   content: ' <' attr(href) '>';
> }
>
> (Same for “content: ' \003C' attr(href) '\003E';”—both should work
> from what I can tell.)
>
> Two of the relevant documents I checked [1,2] seem blissfully unclear
> about concatenation, however it appears (per samples like “string-set:
> author attr(author);”) that this is, indeed, valid CSS.
> Implementations (WebKit) support that notion, for the code is
> supported.
>
> Unless I’m missing something, can the validator team look into this,
> and the CSS working group clarify if necessary?
>
> Cheers,
>  Jens.
>
>
> [1] http://www.w3.org/TR/CSS21/generate.html
> [2] http://www.w3.org/TR/css3-content/

You're correct, that's definitely valid.  This is clear in the 2.1
grammar - there's a long list of string-ish things wrapped in a []+,
which indicates you can use one or more, space-separated.

I'm unsure about who maintains the validator, but I guess you hit the
right mailing list.

~TJ

Reply | Threaded
Open this post in threaded view
|

Re: attr(<identifier>)

Jens Oliver Meiert
(BCC www-style)

> You're correct, that's definitely valid.  This is clear in the 2.1
> grammar - there's a long list of string-ish things wrapped in a []+,
> which indicates you can use one or more, space-separated.

I blindly ran past this :)

--
Jens Oliver Meiert
http://meiert.com/en/

Reply | Threaded
Open this post in threaded view
|

Re: attr(<identifier>)

Yves Lafon

> On 22 Sep 2015, at 17:24, Jens Oliver Meiert <[hidden email]> wrote:
>
> (BCC www-style)
>
>> You're correct, that's definitely valid.  This is clear in the 2.1
>> grammar - there's a long list of string-ish things wrapped in a []+,
>> which indicates you can use one or more, space-separated.
>
> I blindly ran past this :)

The resolution of this bug was waiting some other work for CSS3 attr().
It is now done, so your example is validating as expected.
HTH,

--
Baroula que barouleras, au tiéu toujou t'entourneras.

        ~~Yves







Reply | Threaded
Open this post in threaded view
|

Re: attr(<identifier>)

Jens Oliver Meiert
> The resolution of this bug was waiting some other work for CSS3 attr().
> It is now done, so your example is validating as expected.

Awesome, thanks for the update!

--
Jens Oliver Meiert
http://meiert.com/en/