computed-value-001.html (1598B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>overflow on MathML elements</title> 6 <link rel="help" href="https://w3c.github.io/mathml-core/#user-agent-stylesheet"> 7 <meta name="assert" content="overflow can be overridden on MathML elements."> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="/mathml/support/mathml-fragments.js"></script> 11 <style> 12 /* selector defined in mathml-fragments.js */ 13 .element { 14 overflow: scroll; 15 } 16 </style> 17 </head> 18 <body> 19 <div id="log"></div> 20 <div id="container"> 21 <math class="element"></math> 22 </div> 23 <script> 24 test(function () { 25 var container = document.getElementById("container"); 26 for (tag in MathMLFragments) { 27 // Skip mtable as browsers don't have interoperable behavior for 28 // display: table. 29 // See https://github.com/w3c/csswg-drafts/issues/8133 30 if (tag == "mtable") 31 continue; 32 container.insertAdjacentHTML("beforeend", `<math>${MathMLFragments[tag]}</math>`); 33 } 34 let unknownElement = FragmentHelper.createElement("unknown"); 35 unknownElement.setAttribute("class", "element"); 36 container.appendChild(unknownElement); 37 Array.from(document.getElementsByClassName("element")).forEach(element => { 38 var tag = element.tagName; 39 var style = window.getComputedStyle(element); 40 assert_equals(style["overflow"], "scroll", `overflow on ${tag}`); 41 }, `overflow can be overridden on all MathML elements`); 42 }); 43 </script> 44 </body> 45 </html>