Re: [csswg-drafts] [css-values] attr()'s url type seems wrong (#5079)

> Is there test coverage for that?

Not yet. I can certainly fix this, but it has been something of a moving target over the last few years - from `attr(href)` to `attr(href, url)` to `attr(href url)` to `attr(href type(<url>))` to `string(attr(href type(<url>>)` it's the CSS version of [The Ascent of Ward](http://c2.com/ward/ascent.jpg). attr() dates from CSS2 but its definition has been punted from values-3 to values-4 to values-5, and here we are still talking about it today.

> a serialized URL doesn't work well internationally.

Were we starting from scratch I might agree, but I'm resisting because it's functionality that's in use. Any western-centricness has to be balanced against the need not to break stuff, and if there is a `string()` function to format the URL that's seems like a good place to look at fixing formatting - not ban all URL resolution in CSS.

A quick check shows at least BFO Publisher, Prince, Weasyprint and AH Formatter all accept (or claim to accept) either `attr(href url)` or `attr(href, url)`. Not all of them format it as an absolute URL, but until that's specified somewhere that's not a surprise. The main thing at this point is not to invalidate the syntax entirely.

-- 
GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5079#issuecomment-2796678784 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 11 April 2025 11:44:23 UTC