Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: Rename `string` attr() type to `raw-string`

439 views
Skip to first unread message

Munira Tursunova

unread,
Mar 11, 2025, 5:48:51 AMMar 11
to blink-dev

Contact emails

moo...@google.comand...@chromium.org

Explainer

None

Specification

https://drafts.csswg.org/css-values-5/#attr-notation

Summary

In https://github.com/w3c/csswg-drafts/issues/11645#issuecomment-2701601350 it was resolved to replace `string` attr() type with `raw-string`, see: https://drafts.csswg.org/css-values-5/#attr-notation. Change attr() syntax, so that `attr(data-foo string)` will now become `attr(data-foo raw-string)`.



Blink component

Blink>CSS

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility

Feature was launched recently in M133 and not supported in other browsers yet, so shouldn't be a high risk.



Gecko: No signal

WebKit: No signal

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

This is minor syntax change, doesn't require additional support from DevTools



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/css/css-values/attr-all-types.html?label=master&label=experimental&aligned&q=css%2Fcss-values%2Fattr-all-types.html



Flag name on about://flags

CSSAttrRawString

Finch feature name

CSSAttrRawString

Requires code in //chrome?

False

Tracking bug

https://crbug.com/400981738

Estimated milestones

Shipping on desktop136
Shipping on Android136
Shipping on WebView136


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5191129693421568?gate=5126282800791552

This intent message was generated by Chrome Platform Status.

Mike Taylor

unread,
Mar 13, 2025, 2:09:03 PMMar 13
to Munira Tursunova, blink-dev

On 3/11/25 5:48 AM, 'Munira Tursunova' via blink-dev wrote:

Contact emails

moo...@google.comand...@chromium.org

Explainer

None

Specification

https://drafts.csswg.org/css-values-5/#attr-notation

Summary

In https://github.com/w3c/csswg-drafts/issues/11645#issuecomment-2701601350 it was resolved to replace `string` attr() type with `raw-string`, see: https://drafts.csswg.org/css-values-5/#attr-notation. Change attr() syntax, so that `attr(data-foo string)` will now become `attr(data-foo raw-string)`.



Blink component

Blink>CSS

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility

Feature was launched recently in M133 and not supported in other browsers yet, so shouldn't be a high risk.

Do we have any sense of current usage? And do we have a plan to communicate the change to developers?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAO7W_AkzsbO_zudgyt%3DYy6dBp2OKYcgSZZ2UHnUou0--o8Phg%40mail.gmail.com.

Mike Taylor

unread,
Mar 14, 2025, 1:21:28 PMMar 14
to Bramus Van Damme, blink-dev, Munira Tursunova


On 3/14/25 7:00 AM, Bramus Van Damme wrote:


On Thursday, March 13, 2025 at 7:09:03 PM UTC+1 Mike Taylor wrote:

On 3/11/25 5:48 AM, 'Munira Tursunova' via blink-dev wrote:

Contact emails moo...@google.comand...@chromium.org

Explainer None

Specification https://drafts.csswg.org/css-values-5/#attr-notation

Summary

In https://github.com/w3c/csswg-drafts/issues/11645#issuecomment-2701601350 it was resolved to replace `string` attr() type with `raw-string`, see: https://drafts.csswg.org/css-values-5/#attr-notation. Change attr() syntax, so that `attr(data-foo string)` will now become `attr(data-foo raw-string)`.



Blink component Blink>CSS

TAG review None

TAG review status Pending

Risks


Interoperability and Compatibility

Feature was launched recently in M133 and not supported in other browsers yet, so shouldn't be a high risk.

Do we have any sense of current usage? And do we have a plan to communicate the change to developers?

Usage of `attr(data-x string)` seems pretty much inexistent because:

- This is Chrome-first and so far I’ve only seen a limited set of demos (that do not even use string).
- When a type is omitted - i.e. when using `attr(data-x)` – it behaves like `attr(data-x raw-string)`. The short for is what authors have been using so far.
That sounds promising, but do we have any UseCounter data?

As for communication I have prepared a PR to update MDN: https://github.com/mdn/content/pull/38580 which is awaiting review. The blog post + demos on developer.chrome.com (See https://developer.chrome.com/blog/advanced-attr) do not mention `attr(data-x string)` as the post points to MDN for docs. I can add an update banner to the post.
Thanks for that.

Bramus Van Damme

unread,
Mar 14, 2025, 1:50:54 PMMar 14
to blink-dev, Mike Taylor, Munira Tursunova
On Thursday, March 13, 2025 at 7:09:03 PM UTC+1 Mike Taylor wrote:

On 3/11/25 5:48 AM, 'Munira Tursunova' via blink-dev wrote:

Contact emails moo...@google.comand...@chromium.org

Explainer None

Specification https://drafts.csswg.org/css-values-5/#attr-notation

Summary

In https://github.com/w3c/csswg-drafts/issues/11645#issuecomment-2701601350 it was resolved to replace `string` attr() type with `raw-string`, see: https://drafts.csswg.org/css-values-5/#attr-notation. Change attr() syntax, so that `attr(data-foo string)` will now become `attr(data-foo raw-string)`.



Blink component Blink>CSS

TAG review None

TAG review status Pending

Risks


Interoperability and Compatibility

Feature was launched recently in M133 and not supported in other browsers yet, so shouldn't be a high risk.

Do we have any sense of current usage? And do we have a plan to communicate the change to developers?

Usage of `attr(data-x string)` seems pretty much inexistent because:

- This is Chrome-first and so far I’ve only seen a limited set of demos (that do not even use string).
- When a type is omitted - i.e. when using `attr(data-x)` – it behaves like `attr(data-x raw-string)`. The short for is what authors have been using so far.

As for communication I have prepared a PR to update MDN: https://github.com/mdn/content/pull/38580 which is awaiting review. The blog post + demos on developer.chrome.com (See https://developer.chrome.com/blog/advanced-attr) do not mention `attr(data-x string)` as the post points to MDN for docs. I can add an update banner to the post.
 

Munira Tursunova

unread,
Mar 17, 2025, 10:50:24 AMMar 17
to Mike Taylor, Bramus Van Damme, blink-dev
Thank you, Bramus and Mike.
 
That sounds promising, but do we have any UseCounter data?
 
No, but there is some data gathered from http archive: 'string' type in attr(). I found 15 websites that might cause a potential breakage, so the overall percentage of breakages is under 0,000088%.

Mike Taylor

unread,
Mar 17, 2025, 11:28:20 AMMar 17
to Munira Tursunova, Bramus Van Damme, blink-dev

Thank you for looking into that. Do you have any sense of the relative impact of the breakage for each site, i.e., does some text look funny (low) vs the page is unusable due to broken layout or missing content (high)?

Is there someone on your team that might be able to attempt outreach to get these sites to update?

Alex Russell

unread,
Mar 17, 2025, 2:21:35 PMMar 17
to blink-dev, Mike Taylor, Bramus Van Damme, blink-dev, moo...@google.com
Why would we change this? We backed the original intent with the usual conditions: once the concrete is poured, it's done. I'm not inclined to approve.

Best,

Alex

Munira Tursunova

unread,
Mar 18, 2025, 8:25:00 AMMar 18
to Alex Russell, blink-dev, Mike Taylor, Bramus Van Damme
Do you have any sense of the relative impact of the breakage for each site, i.e., does some text look funny (low) vs the page is unusable due to broken layout or missing content (high)?
I assume theoretically there might be missing content, so high.

Is there someone on your team that might be able to attempt outreach to get these sites to update?
Bramus kindly agreed to help with this.

Why would we change this? We backed the original intent with the usual conditions: once the concrete is poured, it's done. I'm not inclined to approve.
There was a spec change initially raised by Apple after shipping in Blink. I guess we can mention that we wouldn't ship that in Chrome in the CSSWG issue, but I'm not sure if Apple will also ship `string` instead of `raw-string`, which may cause interoperability issues.

Tab Atkins Jr.

unread,
Mar 18, 2025, 3:53:13 PMMar 18
to Alex Russell, blink-dev, Mike Taylor, Bramus Van Damme, moo...@google.com
On Mon, Mar 17, 2025 at 11:21 AM Alex Russell <sligh...@chromium.org> wrote:
> Why would we change this? We backed the original intent with the usual conditions: once the concrete is poured, it's done. I'm not inclined to approve.

That is not, as a general rule, how API owner approval is interpreted,
or (as far as I know) intended. It also drastically conflicts with
usual practice, which has substantial weight of precedent behind it -
while we of course balance the cost of any changes with the benefits,
we are generally *open* to changes requested by other implementors,
particularly when we're the first to advance an API.

In this particular case, the cost is virtually nil - it's a brand new
API with minimal usage, and it's a change to a *default* keyword that
would rarely be written explicitly anyway. (We only have it at all,
rather than just relying on a keyword being absent, due to my own API
design preferences, and the fact that it aids us with a small
back-compat issue.) The benefit of "make other implementors happier
with the API" definitely outweighs the costs here, by any reasonable
metric.

But even in more controversial/costly cases, I strongly contest the
principle you're trying to establish here. We *do* make changes, even
ones with compat pain, as part of our unofficial contract with other
implementors, to make it more palatable to everyone when we push ahead
faster than other implementors are comfortable with or capable of
matching. It's always a judgement call, but it leans *much* further
toward acceptance than "once Blink API owners approve, the concrete is
poured" does.

~TJ

Munira Tursunova

unread,
Mar 20, 2025, 10:09:48 AMMar 20
to Tab Atkins Jr., Alex Russell, blink-dev, Mike Taylor, Bramus Van Damme
Checked the websites with potential breakages, don't observe any breakages. 
The only website with visual differences is https://css3test.com/#css-values-5, but it  "checks which CSS3 features the browser recognizes, not whether they are implemented correctly." (pasted from the website) and links to CSS Values 5 attr() spec: https://www.w3.org/TR/css-values-5/#attr-notation, so should be updated accordingly.

Updated the doc with the findings. 

Vladimir Levin

unread,
Mar 20, 2025, 12:13:34 PMMar 20
to Munira Tursunova, Tab Atkins Jr., Alex Russell, blink-dev, Mike Taylor, Bramus Van Damme
Thank you for checking.

LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Chris Harrelson

unread,
Mar 20, 2025, 12:15:12 PMMar 20
to Vladimir Levin, Munira Tursunova, Tab Atkins Jr., Alex Russell, blink-dev, Mike Taylor, Bramus Van Damme

Mike Taylor

unread,
Mar 20, 2025, 2:46:16 PMMar 20
to Chris Harrelson, Vladimir Levin, Munira Tursunova, Tab Atkins Jr., Alex Russell, blink-dev, Bramus Van Damme

LGTM3 - thanks!

Alex Russell

unread,
Mar 24, 2025, 2:15:35 PMMar 24
to blink-dev, jacka...@gmail.com, blink-dev, Mike Taylor, Bramus Van Damme, moo...@google.com, Alex Russell
I see there are 3 LGTMs now, and I'm not going to block, but I want to be extremely clear that this is not precedent and that folks who have asked for this change should take note that I might block future changes of this sort if we see this kind of thing become a habit from the CSS WG.

Best,

Alex

Bramus Van Damme

unread,
Apr 2, 2025, 7:18:35 AMApr 2
to blink-dev, Alex Russell, jacka...@gmail.com, blink-dev, Mike Taylor, Bramus Van Damme, moo...@google.com
To close the loop: the PR to update MDN got approved just now and should be deployed later today.
Reply all
Reply to author
Forward
0 new messages