Skip to content

fix(css): correct attr() restriction in url-taking functions#44589

Merged
hamishwillee merged 4 commits into
mdn:mainfrom
samson1299:fix/attr-url-limitation
Jun 29, 2026
Merged

fix(css): correct attr() restriction in url-taking functions#44589
hamishwillee merged 4 commits into
mdn:mainfrom
samson1299:fix/attr-url-limitation

Conversation

@samson1299

Copy link
Copy Markdown
Contributor

Fixes #44030

The current docs incorrectly state that attr() can work inside image-set().
Per the CSS Values 5 spec (attr-taint), attr() is forbidden in any function
that could produce a <url>, including image-set() and image().

@samson1299 samson1299 requested a review from a team as a code owner June 27, 2026 13:57
@samson1299 samson1299 requested review from hamishwillee and removed request for a team June 27, 2026 13:57
@github-actions github-actions Bot added the Content:CSS Cascading Style Sheets docs label Jun 27, 2026
@github-actions github-actions Bot added the size/s [PR only] 6-50 LoC changed label Jun 27, 2026
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

Flaws (3)

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/CSS/Reference/Values/attr
Title: attr() CSS function
Flaw count: 3

  • macros:
    • Macro csssyntax produces link /en-US/docs/Web/CSS/Reference/Values/declaration-value which doesn't resolve
    • Macro csssyntax produces link /en-US/docs/Web/CSS/Reference/Values/ident-token which doesn't resolve
    • Macro csssyntax produces link /en-US/docs/Web/CSS/Reference/Values/ident-token which doesn't resolve
External URLs (1)

URL: /en-US/docs/Web/CSS/Reference/Values/attr
Title: attr() CSS function

(comment last updated: 2026-06-29 02:52:00)

Comment thread files/en-us/web/css/reference/values/attr/index.md Outdated

@hamishwillee hamishwillee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @samson1299

This was good. Note again though, you took an issue that is not triaged according to its label - it could have been incorrect. If you're going to take such an issue it would be good to explain why you trust it.

I've subedited a little. What you did was certainly acceptable - I wanted to make sure we mentioned the tainting first.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@hamishwillee hamishwillee merged commit 3e21789 into mdn:main Jun 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed

3 participants