Input elements don't work inside shadow tree
[WebKit-https.git] / LayoutTests / fast / shadow-dom / input-element-in-shadow.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 </head>
5 <body>
6 Test that input elements in shadow trees update when text is entered.
7 <div id="parentDiv">
8 <input placeholder="distributed"><br>
9 <textarea></textarea>
10 </div>
11 </body>
12 <script>
13 parentDiv.attachShadow({mode: 'open'});
14 var innerDiv = document.createElement('div');
15 innerDiv.appendChild(document.createElement('slot'))
16 parentDiv.shadowRoot.appendChild(innerDiv);
17
18 function enterText(selector, characters)
19 {
20     if (window.eventSender) {
21         var input = document.querySelector(selector);
22         input.focus();
23         for (c of characters)
24             window.eventSender.keyDown(c);
25         input.blur();
26     }
27 }
28
29 enterText("input", "abc");
30 enterText("textarea", "def");
31
32 </script>
33 </html>