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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/active-pseudo-and-focus-move.html

Issue 1827363003: :active state should stick while mouse button is pressed regardless of focus state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indentation (TAB) Created 4 years, 9 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/Document.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/active-pseudo-and-focus-move.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/active-pseudo-and-focus-move.html b/third_party/WebKit/LayoutTests/fast/css/active-pseudo-and-focus-move.html
new file mode 100644
index 0000000000000000000000000000000000000000..8006b9278e7814c3d38cb4d3ff61276e73a7b875
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/active-pseudo-and-focus-move.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<script src='../../resources/testharness.js'></script>
+<script src='../../resources/testharnessreport.js'></script>
+<style>
+input { background-color: black; }
+input:active { background-color: red; }
+</style>
+<div id="sandbox">
+ <input id="i1" type="button"><input id="i2" type="button">
+</div>
+<script>
+if (window.eventSender) {
+ test(() => {
+ var i1 = document.querySelector('#i1');
+ var x = i1.offsetLeft + i1.offsetWidth / 2;
+ var y = i1.offsetTop + i1.offsetHeight / 2;
+ eventSender.mouseMoveTo(x, y);
+
+ var i2 = document.querySelector('#i2');
+
+ assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(0, 0, 0)');
+ assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
+
+ // Press mouse button
+ eventSender.mouseDown();
+ assert_equals(document.activeElement.id, 'i1');
+ assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(255, 0, 0)');
+ assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
+
+ // Moving focus via TAB
+ eventSender.keyDown('\t');
+ assert_equals(document.activeElement.id, 'i2');
+ assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(255, 0, 0)');
+ assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
+
+ // Release mouse button
+ eventSender.mouseUp();
+ assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(0, 0, 0)');
+ assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
+
+ sandbox.remove();
+ }, ":active state should stick while mouse button is pressed regardless of focus state.");
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698