OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <body> | |
3 <script src="../../../resources/js-test.js"></script> | |
4 | |
5 <input type="button" value="Button" style="padding:10px; -webkit-appearance:none
;" onclick="++clickCount"> | |
6 <div id=console></div> | |
7 | |
8 <script> | |
9 description('Make sure that mouse click on an input button with shadow nodes wor
ks.'); | |
10 var clickCount = 0; | |
11 var input = document.querySelector('input'); | |
12 var root = input.createShadowRoot(); | |
13 root.innerHTML = '<span style="margin:8px;">Foo</span><shadow></shadow><span>Bar
</span>'; | |
14 var inputRect = input.getBoundingClientRect(); | |
15 var shadowNodeRect = root.firstChild.getBoundingClientRect(); | |
16 | |
17 debug('Click on the padding area of the button:'); | |
18 eventSender.mouseMoveTo(inputRect.left + 3, inputRect.top + inputRect.height / 2
); | |
19 eventSender.mouseDown(); | |
20 eventSender.mouseUp(); | |
21 shouldBe('clickCount', '1'); | |
22 | |
23 debug('Click on the margin area of a shadow node:'); | |
24 clickCount = 0; | |
25 eventSender.mouseMoveTo(shadowNodeRect.left - 3, shadowNodeRect.top + shadowNode
Rect.height / 2); | |
26 eventSender.mouseDown(); | |
27 eventSender.mouseUp(); | |
28 shouldBe('clickCount', '1'); | |
29 | |
30 debug('Click on the middle of a shadow node:'); | |
31 clickCount = 0; | |
32 eventSender.mouseMoveTo(shadowNodeRect.left + shadowNodeRect.width / 2, shadowNo
deRect.top + shadowNodeRect.height / 2); | |
33 eventSender.mouseDown(); | |
34 eventSender.mouseUp(); | |
35 shouldBe('clickCount', '1'); | |
36 | |
37 debug('Click on the original value text:'); | |
38 clickCount = 0; | |
39 eventSender.mouseMoveTo(shadowNodeRect.right + 10, shadowNodeRect.top + shadowNo
deRect.height / 2); | |
40 eventSender.mouseDown(); | |
41 eventSender.mouseUp(); | |
42 shouldBe('clickCount', '1'); | |
43 </script> | |
44 | |
45 </body> | |
46 | |
OLD | NEW |