Files
rust_browser/tests/goldens/fixtures/207-content-attr.html
Zachary D. Rowitsch 72f4713923
All checks were successful
ci / fast (linux) (push) Successful in 7m14s
Implement CSS attr() function for content property (CSS 2.1 §12.2)
Add support for the attr() function in CSS content property values,
enabling patterns like `content: " (" attr(href) ")"` on ::before/::after
pseudo-elements. The implementation parses attr() at CSS parse time into
ContentValue::Items, then resolves attribute references against the DOM
during pseudo-element style computation, converting to ContentValue::String
before layout sees it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 00:39:48 -04:00

13 lines
206 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
a { display: block; font-size: 16px; }
a::after { content: " (" attr(href) ")"; }
</style>
</head>
<body>
<a href="https://example.com">Example</a>
</body>
</html>