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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/hover-display-contents.html

Issue 2790133002: Allow display:contents elements in hover chain. (Closed)
Patch Set: Fixed nits. Created 3 years, 8 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 | « no previous file | third_party/WebKit/Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698