tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

dir-shadow-35.html (1234B)


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