wm-propagation-body-computed-writing-mode.html (1444B)
1 <!DOCTYPE html> 2 <html> 3 4 <title>Computed root element writing-mode style when propagating writing-mode from body</title> 5 <link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow"> 6 <link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> 7 8 <body> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script> 12 const writingModes = ["horizontal-tb", "vertical-lr", "vertical-rl", "sideways-lr", "sideways-rl"]; 13 for (const rootWM of writingModes) { 14 for (const bodyWM of writingModes) { 15 test(function(t) { 16 t.add_cleanup(() => { 17 document.documentElement.style.removeProperty("writing-mode"); 18 document.body.style.removeProperty("writing-mode"); 19 }); 20 document.documentElement.style.writingMode = rootWM; 21 document.body.style.writingMode = bodyWM; 22 assert_equals(getComputedStyle(document.documentElement).writingMode, rootWM, "root computed writing mode should be correct"); 23 assert_equals(getComputedStyle(document.body).writingMode, bodyWM, "body computed writing mode should be correct"); 24 }, `Computed style is as specified with ${bodyWM} on body & ${rootWM} on html`); 25 } 26 } 27 </script> 28 </body> 29 30 </html>