direction.html (2165B)
1 <!DOCTYPE html> 2 <html dir="rtl"> 3 <head> 4 <meta charset="utf-8"/> 5 <title>Verify computed direction</title> 6 <link rel="help" href="https://w3c.github.io/mathml-core/#attributes-common-to-html-and-mathml-elements"> 7 <link rel="help" href="https://w3c.github.io/mathml-core/#the-top-level-math-element"> 8 <meta name="assert" content="Verify computed direction value."> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script> 12 setup({ explicit_done: true }); 13 window.addEventListener("load", runTests); 14 function runTests() { 15 test(function() { 16 assert_equals(window.getComputedStyle(document.getElementById('x1')).direction, "ltr"); 17 assert_equals(window.getComputedStyle(document.getElementById('x2')).direction, "ltr"); 18 assert_equals(window.getComputedStyle(document.getElementById('x3')).direction, "ltr"); 19 assert_equals(window.getComputedStyle(document.getElementById('x4')).direction, "rtl"); 20 }, "Check direction"); 21 22 done(); 23 } 24 </script> 25 </head> 26 <body> 27 <!-- Test the CSS direction and dir attribute on the <math> element. It 28 should be "ltr", except if an explicit dir="rtl" is used. --> 29 30 <p>שורשי משוואה מודגשת זו <math id="x1"> <mrow> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mrow> </math> מודגשים גם הם</p> 31 32 <p>שורשי משוואה מודגשת זו <math id="x2" dir="ltr"> <mrow> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mrow> </math> מודגשים גם הם</p> 33 34 <p>שורשי משוואה מודגשת זו <math id="x3" dir="invalid"> <mrow> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mrow> </math> מודגשים גם הם</p> 35 36 <p>שורשי משוואה מודגשת זו <math id="x4" dir="rtl"> <mrow> <msup> <mi>y</mi> <mn>3</mn> </msup> <mo>+</mo> <mi>p</mi> <mi>y</mi> <mo>+</mo> <mi>q</mi> <mo>=</mo> <mn>0</mn> </mrow> </math> מודגשים גם הם</p> 37 38 </body> 39 </html>