-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathcss3-modsel-65.xml
More file actions
41 lines (38 loc) · 1.77 KB
/
Copy pathcss3-modsel-65.xml
File metadata and controls
41 lines (38 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>NEGATED :focus pseudo-class</title>
<style type="text/css"><![CDATA[a:not(:focus) { background-color: transparent; }
a { background-color: lime; }
]]></style>
<link rel="author" title="Daniel Glazman" href="http://glazman.org/"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="common.js"></script>
<link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found -->
</head>
<body>
<p>The background color of all <a id="t1" href="#foo">anchors</a>
should become <a id="t2" href="#foo"> green</a> when they have the
<a id="t3" href="#foo">focus</a>.</p>
<script><![CDATA[
test(() => {
const TRANSPARENT = 'rgba(0, 0, 0, 0)';
const t1 = document.getElementById('t1');
const t2 = document.getElementById('t2');
const t3 = document.getElementById('t3');
assert_background_color(t1, TRANSPARENT, 't1 initially transparent');
assert_background_color(t2, TRANSPARENT, 't2 initially transparent');
assert_background_color(t3, TRANSPARENT, 't3 initially transparent');
t1.focus();
assert_background_color(t1, LIME, 't1 focused is lime');
assert_background_color(t2, TRANSPARENT, 't2 transparent when t1 focused');
assert_background_color(t3, TRANSPARENT, 't3 transparent when t1 focused');
t2.focus();
assert_background_color(t1, TRANSPARENT, 't1 transparent when t2 focused');
assert_background_color(t2, LIME, 't2 focused is lime');
assert_background_color(t3, TRANSPARENT, 't3 transparent when t2 focused');
}, 'NEGATED :focus pseudo-class');
]]></script>
</body>
</html>