attr-IACVT.html (949B)
1 <!DOCTYPE html> 2 <title>CSS Values Test: attr() IACVT</title> 3 <meta name="assert" content="Fail to substitute attr() should be IACVT."> 4 <link rel="help" href="https://drafts.csswg.org/css-values-5/#attr-notation"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <style> 8 #expected { 9 background-color: red; 10 } 11 #test { 12 background-color: red; 13 background-color: attr(data-color type(<color>)); 14 } 15 </style> 16 <div id="test" data-color=333></div> 17 <div id="expected"></div> 18 19 <script> 20 var elem = document.getElementById("test"); 21 var value = window.getComputedStyle(elem).getPropertyValue("background-color"); 22 23 var expected_elem = document.getElementById("expected"); 24 var expected_value = window.getComputedStyle(expected_elem).getPropertyValue("background-color"); 25 test(() => { 26 assert_not_equals(value, expected_value); 27 }); 28 </script>