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

Side by Side 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: revise test. Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src='../../resources/testharness.js'></script>
3 <script src='../../resources/testharnessreport.js'></script>
4 <style>
5 input { background-color: black; }
6 input:active { background-color: red; }
7 </style>
8 <div id="sandbox">
9 <input id="i1" type="button"><input id="i2" type="button">
10 </div>
11 <script>
12 test(() => {
13 if (window.eventSender) {
14 var i1 = document.querySelector('#i1');
tkent 2016/03/25 08:33:13 indentation looks ugly.
kochi 2016/03/25 08:43:51 Oops, hard TAB sneaked in. Fixed. (also swapped t
15 var x = i1.offsetLeft + i1.offsetWidth / 2;
16 var y = i1.offsetTop + i1.offsetHeight / 2;
17 eventSender.mouseMoveTo(x, y);
18
19 var i2 = document.querySelector('#i2');
20
21 assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(0, 0, 0)');
22 assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
23
24 // Press mouse button
25 eventSender.mouseDown();
26 assert_equals(document.activeElement.id, 'i1');
27 assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(255, 0, 0)');
28 assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
29
30 // Moving focus via TAB
31 eventSender.keyDown('\t');
32 assert_equals(document.activeElement.id, 'i2');
33 assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(255, 0, 0)');
34 assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
35
36 // Release mouse button
37 eventSender.mouseUp();
38 assert_equals(getComputedStyle(i1).backgroundColor, 'rgb(0, 0, 0)');
39 assert_equals(getComputedStyle(i2).backgroundColor, 'rgb(0, 0, 0)');
40
41 sandbox.remove();
42 }
43 }, ":active state should stick while mouse button is pressed regardless of focus state.");
44 </script>
OLDNEW
« 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