Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: LayoutTests/fast/css/clear-activechain-list-shadow-dom.html

Issue 317733004: Update an Element's ancestor chain at the end of its activation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed assert Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/css/clear-activechain-list-shadow-dom.html
diff --git a/LayoutTests/fast/css/clear-activechain-list-shadow-dom.html b/LayoutTests/fast/css/clear-activechain-list-shadow-dom.html
new file mode 100644
index 0000000000000000000000000000000000000000..b3b056835c2942d9fbec5a588dc7e88541e17a02
--- /dev/null
+++ b/LayoutTests/fast/css/clear-activechain-list-shadow-dom.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<style>
+ div {
+ background-color: #00ffff;
+ width: 100px;
+ height: 100px;
+ }
+ span:active {
+ display: none;
+ }
+</style>
+
+<div>
+<div id='host'>
+ <span>Click Me</span>
+</div>
+</div>
+
+<pre id='description'></pre>
+<pre id='console'></pre>
+
+<script src='../../resources/js-test.js'></script>
+
+<script>
+var root = document.getElementById('host').createShadowRoot();
+root.innerHTML =
+ '<style> div {background-color: #00ff00;}div:active {background-color: #ff0000;}</style><div id=shadowdom style="width: 100px; height: 100px"><content></content></div>'
+
+function shouldHaveBackground(element, bg) {
+ background = getComputedStyle(element, null).getPropertyValue('background-color');
+ shouldBeEqualToString('background', bg);
+}
+
+description('Chain of active elements should be cleared including the Shadow DOM elements');
+
+if (window.testRunner) {
+ var shadow = root.querySelector('#shadowdom');
+
+ eventSender.dragMode = false;
+ // This mouse click seems to be required for WebKit's event handling to
+ // pick up the :hover class. See https://bugs.webkit.org/show_bug.cgi?id=74264
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+
+ var span = document.querySelector('span');
+ var spanRect = span.getBoundingClientRect();
+ // Mouse over the span.
+ eventSender.mouseMoveTo(spanRect.left + 5, spanRect.top + 5);
+ shouldHaveBackground(shadow, 'rgb(0, 255, 0)');
+ eventSender.mouseDown();
+ shouldHaveBackground(shadow, 'rgb(255, 0, 0)');
+ eventSender.mouseUp();
+ shouldHaveBackground(shadow, 'rgb(0, 255, 0)');
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698