overlay-user-agent-rules.html (1522B)
1 <!DOCTYPE html> 2 <link rel=author href="mailto:jarhar@chromium.org"> 3 <link rel=help href="https://github.com/whatwg/html/pull/9093"> 4 <link rel=help href="https://drafts.csswg.org/css-position-4/#overlay"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <title>CSS Position Test: User agent style for overlay</title> 8 9 <style> 10 div { 11 overlay: auto; 12 } 13 </style> 14 15 <body> 16 <script> 17 test(() => { 18 const div = document.createElement('div'); 19 document.body.appendChild(div); 20 div.style.overlay = 'auto'; 21 assert_equals(getComputedStyle(div).overlay, 'none'); 22 }, 'HTML elements should have overlay:none !important from the user-agent.'); 23 24 test(() => { 25 const svg = document.createElement('svg'); 26 document.body.appendChild(svg); 27 svg.style.overlay = 'auto'; 28 assert_equals(getComputedStyle(svg).overlay, 'none'); 29 }, 'SVG elements should have overlay:none !important from the user-agent.'); 30 31 test(() => { 32 const nullNamespace = document.createElementNS(null, 'div'); 33 document.body.appendChild(nullNamespace); 34 assert_equals(getComputedStyle(nullNamespace).overlay, 'none'); 35 }, 'Null namespace elements should have overlay:none !important from the user-agent.'); 36 37 test(() => { 38 const weirdNamespace = document.createElementNS('hello world', 'div'); 39 document.body.appendChild(weirdNamespace); 40 assert_equals(getComputedStyle(weirdNamespace).overlay, 'none'); 41 }, 'Arbitrary namespace elements should have overlay:none !important from the user-agent.'); 42 </script>