File: with_shadow.erb

package info (click to toggle)
ruby-capybara 3.40.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,368 kB
  • sloc: ruby: 23,988; javascript: 752; makefile: 11
file content (31 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<%# Borrowed from Titus Fortner %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Shadow DOM</title>
  </head>
  <body>
    <div id="no_host"></div>
    <div id="shadow_host"></div>
    <a href="scroll.html">scroll.html</a>
    <script>
      let shadowRoot = document.getElementById('shadow_host').attachShadow({mode: 'open'});
      shadowRoot.innerHTML = `
              <span class="wrapper" id="shadow_content"><span class="info">some text</span></span>
              <div id="nested_shadow_host"></div>
              <a href="scroll.html">scroll.html</a>
	  		  <div id="controls_wrapper">
                <input type="text" />
                <input type="checkbox" id="shadow_checkbox" />
                <input type="file" />
	 		  </div>
            `;

      let nestedShadowRoot = shadowRoot.getElementById('nested_shadow_host').attachShadow({mode: 'open'});
      nestedShadowRoot.innerHTML = `
              <div id="nested_shadow_content"><div>nested text</div></div>
            `;
    </script>
  </body>
</html>