-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathcss3-modsel-14.xml
More file actions
43 lines (38 loc) · 1.83 KB
/
Copy pathcss3-modsel-14.xml
File metadata and controls
43 lines (38 loc) · 1.83 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
42
43
<!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>More than one class selector</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style type="text/css"><![CDATA[p { background-color : red ; border : thick solid red ; padding : 1em }
p.t1 { background-color : lime }
p.t2 { border : thick solid green }
div { background: green; color: white; }
div.teST { background: red; color: yellow; }
div.te { background: red; color: yellow; }
div.st { background: red; color: yellow; }
div.te.st { background: red; color: yellow; }]]></style>
<link rel="author" title="Daniel Glazman" href="http://glazman.org/"/>
<link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
<link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found -->
</head>
<body>
<p id="target1" class="t1 t2">This paragraph
should have a green background and a green thick solid border because
it carries both classes t1 and t2.</p>
<div id="target2" class="test">This line
should be green.</div>
<script><![CDATA[
test(function() {
const t1 = document.getElementById('target1');
assert_equals(getComputedStyle(t1).backgroundColor, 'rgb(0, 255, 0)', 'background-color');
assert_equals(getComputedStyle(t1).borderLeftColor, 'rgb(0, 128, 0)', 'border-left-color');
assert_equals(getComputedStyle(t1).borderLeftStyle, 'solid', 'border-left-style');
}, "p.t1.t2 should have green background and border");
test(function() {
const t2 = document.getElementById('target2');
assert_equals(getComputedStyle(t2).backgroundColor, 'rgb(0, 128, 0)', 'background-color');
}, "div.test should have green background");
]]></script>
</body>
</html>