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-number-invalidation.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title> CSS Values and Units Test: Attribute references (number type) invalidation </title>
<link rel="author" title="Suraj Thanugundla" href="mailto:contact@surajt.com">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<style>
#container {
height: 100px;
width: 100px;
background: red;
columns: attr(data-foo number);
column-gap: 0;
}
#inner {
height: 200px;
width: 50px;
background: green;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div id="container" data-foo="3">
<div id="inner"></div>
</div>
<script>
const element = document.getElementById("container");
element.getBoundingClientRect();
element.setAttribute("data-foo", "2");
</script>