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..0cc39d27e8050769cb85b87a34cd5a112e6f12fc |
--- /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 |
Manuel Rego
2017/04/05 16:17:51
Nit: Missing ";" at the end.
|
+ } |
+</style> |
+<div id="c1"> |
Manuel Rego
2017/04/05 16:17:51
Nit: Use "container-1" and "target-1", etc. so the
|
+ <div id="t1" class="contents">Hovering this text should make it go green. |
+ There should be no red border at any time.</div> |
+</div> |
+<div id="c2"> |
+ <div class="contents"> |
+ <div id="t2">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(c1); |
+ assert_equals(getComputedStyle(t1).color, "rgb(0, 128, 0)", |
+ "Color should be green."); |
+ }, "Hover text with :hover style on display:contents parent."); |
+ |
+ test(() => { |
+ hoverElement(c2); |
+ assert_equals(getComputedStyle(t2).color, "rgb(0, 128, 0)", |
+ "Color should be green."); |
+ }, "Hover text with :hover style on display:contents ancestor."); |
+</script> |