Index: third_party/WebKit/LayoutTests/fast/css/hover-display-contents.html |
diff --git a/third_party/WebKit/LayoutTests/fast/css/hover-display-contents.html b/third_party/WebKit/LayoutTests/fast/css/hover-display-contents.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d05cc0b58ff6501bf71a8ac90f1fd9041c0761b0 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/css/hover-display-contents.html |
@@ -0,0 +1,43 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<style> |
+ .contents { |
+ display: contents; |
+ border: 1px solid red; |
+ } |
+ .contents:hover { |
+ color: green; |
+ } |
+</style> |
+<div id="container1"> |
+ <div id="target1" class="contents">Hovering this text should make it go green. |
+ There should be no red border at any time.</div> |
+</div> |
+<div id="container2"> |
+ <div class="contents"> |
+ <div id="target2">Hovering this text should make it go green. |
+ There should be no red border at any time.</div> |
+ </div> |
+</div> |
+<script> |
+ function hoverElement(element) { |
+ eventSender.mouseMoveTo(element.offsetLeft + 1, element.offsetTop + 1); |
+ } |
+ |
+ test(() => { |
+ assert_true(!!window.eventSender, "Check for window.eventSender"); |
+ }, "Tests require window.eventSender for hovering."); |
+ |
+ test(() => { |
+ hoverElement(container1); |
+ assert_equals(getComputedStyle(target1).color, "rgb(0, 128, 0)", |
+ "Color should be green."); |
+ }, "Hover text with :hover style on display:contents parent."); |
+ |
+ test(() => { |
+ hoverElement(container2); |
+ assert_equals(getComputedStyle(target2).color, "rgb(0, 128, 0)", |
+ "Color should be green."); |
+ }, "Hover text with :hover style on display:contents ancestor."); |
+</script> |