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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/pseudo-hover-active-display-none.html

Issue 2095833003: :active pseudo class is not applied for element with display none. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated test case which require LocalStyleChange calculation from both setActive and setHover Created 4 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
Index: third_party/WebKit/LayoutTests/fast/css/pseudo-hover-active-display-none.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/pseudo-hover-active-display-none.html b/third_party/WebKit/LayoutTests/fast/css/pseudo-hover-active-display-none.html
new file mode 100644
index 0000000000000000000000000000000000000000..09c7d24a93bff5be8f83edd0715077cfcd130bab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/pseudo-hover-active-display-none.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<input type="submit" id="sub1"/>
+<input type="submit" id="sub2"/>
+<style>
+#sub1:active {
+ display: none;
+}
+#sub2:hover {
+ display: none;
+}
+</style>
+<script>
+if (window.eventSender) {
+ // Tests if the display style is applied and restored properly when display:none is set on active state
+ var b1 = document.getElementById("sub1");
+ var startX = b1.offsetLeft + b1.offsetWidth/2;
+ var startY = b1.offsetTop + b1.offsetHeight/2;
+ var endX = startX + b1.offsetWidth;
+ var endY = startY + b1.offsetHeight;
+ eventSender.dragMode = true;
+ eventSender.mouseMoveTo(startX, startY);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(endX, endY);
+ eventSender.mouseUp();
+
+ // Tests if the display style is applied and restored properly when display:none is set on hover state
+ var b2 = document.getElementById("sub2");
+ var x = b2.offsetLeft + b2.offsetWidth/2;
+ var y = b2.offsetTop + b2.offsetHeight/2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseMoveTo(x + b2.offsetWidth, y + b2.offsetHeight);
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698