Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/attr-security-transition.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Values and Units Test: attr() security limitations</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@property --s {
syntax: "<string>";
inherits: false;
initial-value: "x";
}
#attr {
--s: attr(href);
transition: --s 10s allow-discrete -9s;
background-image: image-set(var(--s));
}
@starting-style {
#attr { --s: "x"; }
}
</style>
<html>
<body>
</body>
</html>
<script>
var elem = document.getElementById("attr");
test(() => {
assert_equals(window.getComputedStyle(elem).getPropertyValue("background-image"), 'none');
}, `background-image value should be attr-tainted`);
</script>