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..83ecaac9195d3fd5955c4034d95310ecc1f470a7 |
--- /dev/null |
+++ b/LayoutTests/fast/css/clear-activechain-list.html |
@@ -0,0 +1,56 @@ |
+<!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"></div> |
Inactive
2014/06/13 13:15:33
Why are those 2 <pre>...</pre> needed? AFAIK, the
spartha
2014/06/13 14:28:14
You are right, js-test.js adds these for us (adds
|
+<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); |
+ } |
+ |
+ if (window.testRunner) { |
+ description("Chain of active elements should be cleared, even if style :active sets display: none on the current active element"); |
Inactive
2014/06/13 13:15:33
This can probably be outside the if(window.testRun
spartha
2014/06/13 14:28:14
Done.
|
+ var box = document.getElementById('box'); |
+ testRunner.dumpAsText(); |
Inactive
2014/06/13 13:15:33
This is the default.
spartha
2014/06/13 14:28:14
Done.
|
+ |
+ 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> |