4 background-color: #
00ffff;
19 <pre id='description'
></pre>
20 <pre id='console'
></pre>
22 <script src='../../resources/js-test.js'
></script>
25 var root
= document
.getElementById('host').createShadowRoot();
27 '<style> div {background-color: #00ff00;}div:active {background-color: #ff0000;}</style><div id=shadowdom style="width: 100px; height: 100px"><content></content></div>'
29 function shouldHaveBackground(element
, bg
) {
30 background
= getComputedStyle(element
, null).getPropertyValue('background-color');
31 shouldBeEqualToString('background', bg
);
34 description('Chain of active elements should be cleared including the Shadow DOM elements');
36 if (window
.testRunner
) {
37 var shadow
= root
.querySelector('#shadowdom');
39 eventSender
.dragMode
= false;
40 // This mouse click seems to be required for WebKit's event handling to
41 // pick up the :hover class. See https://bugs.webkit.org/show_bug.cgi?id=74264
42 eventSender
.mouseDown();
43 eventSender
.mouseUp();
45 var span
= document
.querySelector('span');
46 var spanRect
= span
.getBoundingClientRect();
47 // Mouse over the span.
48 eventSender
.mouseMoveTo(spanRect
.left
+ 5, spanRect
.top
+ 5);
49 shouldHaveBackground(shadow
, 'rgb(0, 255, 0)');
50 eventSender
.mouseDown();
51 shouldHaveBackground(shadow
, 'rgb(255, 0, 0)');
52 eventSender
.mouseUp();
53 shouldHaveBackground(shadow
, 'rgb(0, 255, 0)');