7 box-shadow:
0 0 50px #
000;
16 background: rgba(
0,
255,
0,
0.3);
19 <script src=
"../../resources/js-test.js"></script>
21 if (window
.testRunner
)
22 testRunner
.dumpAsText();
26 if (window
.eventSender
) {
27 eventSender
.mouseMoveTo(x
, y
);
28 eventSender
.mouseDown();
29 eventSender
.mouseUp();
33 function test(name
, fn
)
39 description("This test checks that div block should not get events on clicking the shadow outside div block.");
44 test("Focus should remain in the textarea", function() {
45 var textarea
= document
.getElementById("content");
46 var rect
= textarea
.getBoundingClientRect();
47 click(rect
.left
+ 5, rect
.top
+ 5);
48 shouldBeEqualToString("document.activeElement.tagName", "TEXTAREA");
51 // Click on the shadow at right of the div block.
52 test("Focus should move to the body", function() {
53 var shadow
= document
.getElementById("shadow");
54 var rect
= shadow
.getBoundingClientRect();
55 var x
= rect
.left
+ shadow
.offsetWidth
+ 5;
58 shouldBeEqualToString("document.activeElement.tagName", "BODY");
61 // Focus on the textarea to prepare for the next test.
62 test("Focus should remain in the textarea", function() {
63 var textarea
= document
.getElementById("content");
64 var rect
= textarea
.getBoundingClientRect();
65 click(rect
.left
+ 5, rect
.top
+ 5);
66 shouldBeEqualToString("document.activeElement.tagName", "TEXTAREA");
69 // Click on the shadow at bottom of the div block.
70 test("Focus should move to the body", function() {
71 var shadow
= document
.getElementById("shadow");
72 var rect
= shadow
.getBoundingClientRect();
73 var x
= rect
.left
+ 5;
74 var y
= rect
.top
+ shadow
.offsetHeight
+ 5;
76 shouldBeEqualToString("document.activeElement.tagName", "BODY");
82 <body onload=
"runTests();">
84 <textarea id=
"content"></textarea>