test_pseudo_display_fixup.html (844B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>Test item blockification of pseudo-elements</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <style> 7 #test { 8 display: flex; 9 } 10 #test::before, #test::after { 11 content: "test"; 12 display: inline-block; 13 color: green; 14 /* 15 * NOTE(emilio): The transition rule is very intentional, to avoid testing 16 * the eagerly resolved style. 17 */ 18 transition: color 1s ease; 19 } 20 </style> 21 <div id="test"></div> 22 <script> 23 test(function() { 24 document.body.offsetTop; 25 let test = document.getElementById("test"); 26 assert_equals(getComputedStyle(test, "::before").display, "block"); 27 assert_equals(getComputedStyle(test, "::after").display, "block"); 28 }, "::before and ::after pseudo-elements are blockified"); 29 </script>