dir-shadow-24.html (1080B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"/> 5 <title>[dir] and shadow slots: dir=auto on the div (shadow host), text in the shadow tree</title> 6 <link rel="author" title="Eric Meyer" href="mailto:emeyer@igalia.com"> 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/C#the-dir-attribute"> 8 <link rel="help" href="https://github.com/whatwg/html/issues/3699"> 9 <link rel="help" href="https://github.com/whatwg/html/pull/9796"> 10 <link rel="match" href="dir-shadow-24-ref.html"> 11 <style type="text/css"> 12 body {width: 600px;} 13 div {border: 1px solid gray; margin: 1em;} 14 </style> 15 <script src="dir-shadow-utils.js"></script> 16 </head> 17 <body> 18 19 <p>`dir=auto` on the div (shadow host), text in the shadow tree</p> 20 <div id="host" dir="auto"></div> 21 <p id="result">The HTML direction / computed CSS `direction` value for the host’s text is: </p> 22 23 <script type="text/javascript"> 24 let root = host.attachShadow({mode:"open"}); 25 root.innerHTML = `اختبر.`; 26 result.innerHTML += html_direction(host) + " / " + getComputedStyle(host).direction + '.'; 27 </script> 28 29 </body> 30 </html>