Files
sousa-gecko/testing/web-platform/tests/css/css-values/attr-pseudo-element-marker.html
T
Swarup Ukil 4e99e4a115 Bug 2024341 - Ensure pseudo-elements that use attr() recascade when their originating element's attribute changes. r=emilio,firefox-style-system-reviewers,layout-reviewers
As it stood, if the originating element did not use attr(data) while
its pseudo-elements did use attr(data), then if data's value changed,
we would miss recascading the pseudo and leave them stale.

This patch only covers some pseudo-elements: generated content pseudo
elements (::marker, ::after, ::marker, ::backdrop), ::first-letter and
::first-line, and UA widget pseudos.

More work is needed for the remaining pseudos: Bug 2037724

Differential Revision: https://phabricator.services.mozilla.com/D299040
2026-05-12 18:06:49 +00:00

16 lines
625 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Values and Units Test: attr() in ::marker pseudo element</title>
<link rel="author" title="Swarup Ukil" href="mailto:sukil@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-values/#attr-notation">
<link rel="match" href="attr-pseudo-element-marker-ref.html">
<style>
li::marker { color: attr(data-color type(<color>), red); }
</style>
<ul><li id="special-bullet" data-color="yellow">Text</li></ul>
<script>
const bullet = document.getElementById("special-bullet");
bullet.getBoundingClientRect();
bullet.setAttribute("data-color", "green");
</script>