dir-shadow-08.html (1159B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"/> 5 <title>[dir] and shadow slots: dir=ltr on the shadow host, paragraph in the light 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-08-ref.html"> 11 <style type="text/css"> 12 body {width: 600px;} 13 div {border: 1px solid gray; margin: 1em;} 14 div p {width: 50%; border: 1px dotted;} 15 </style> 16 <script src="dir-shadow-utils.js"></script> 17 </head> 18 <body> 19 20 <p>`dir=ltr` on the shadow host, paragraph in the light tree</p> 21 <div id="host" dir="ltr"><p>اختبر.</p></div> 22 <p id="result">The HTML direction / computed CSS `direction` value for the paragraph is: </p> 23 24 <script type="text/javascript"> 25 let root = host.attachShadow({mode:"open"}); 26 root.innerHTML = ` 27 <slot></slot> 28 `; 29 result.innerHTML += html_direction(host.firstChild) + " / " + getComputedStyle(host.firstChild).direction + '.'; 30 </script> 31 32 </body> 33 </html>