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

Unified Diff: LayoutTests/fast/css/clear-activechain-list.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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/css/clear-activechain-list-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/clear-activechain-list.html
diff --git a/LayoutTests/fast/css/clear-activechain-list.html b/LayoutTests/fast/css/clear-activechain-list.html
new file mode 100644
index 0000000000000000000000000000000000000000..fdc55f278aa33ed88d0b49787bc9b0126be6258b
--- /dev/null
+++ b/LayoutTests/fast/css/clear-activechain-list.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<style>
+ div { background: rgb(0, 0, 0); }
+ div:active { background: rgb(0, 255, 0); }
+ div {
+ width: 200px;
+ height: 200px;
+ border: 2px solid rgb(0, 0, 255);
+ }
+ div span {
+ color: rgb(255, 255, 255);
+ }
+ div:active span {
+ color: rgb(255, 0, 0);
+ display: none;
+ }
+</style>
+
+<div id="box"><span>Text in a span</span></div>
+<pre id="description"></pre>
+<pre id="console"></pre>
+
+<script src="../../resources/js-test.js"></script>
+<script>
+ function shouldHaveBackground(element, bg) {
+ background = getComputedStyle(element, null).getPropertyValue("background-color");
+ shouldBeEqualToString('background', bg);
+ }
+
+ function shouldHaveTextColor(element, textColor) {
+ color = getComputedStyle(element, null).getPropertyValue("color");
+ shouldBeEqualToString('color', textColor);
+ }
+
+ description("Chain of active elements should be cleared, even if style :active sets display: none on the current active element");
+
+ if (window.testRunner) {
+ var box = document.getElementById('box');
+
+ 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();
+ // Move into the first box.
+ eventSender.mouseMoveTo(spanRect.left + 5, spanRect.top + 5);
+ eventSender.mouseDown();
+ shouldHaveBackground(box, 'rgb(0, 255, 0)');
+ eventSender.mouseUp();
+ shouldHaveTextColor(span, 'rgb(255, 255, 255)');
+ }
+</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/css/clear-activechain-list-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698