summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/pseudo-default-003.html
blob: 09fd10bf15eccd40234849d12ee90ec62d5458a4 (plain)
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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
<style>
 input { background: red; }
 button { background: red; }
 :default { background: lime; }
</style>
</head>
<body>
<p id="description"></p>
<form method="get">
<button name="victim" type="submit"/>Submit</button>
<input name="victim" type="submit" value="Submit" />
<input name="victim" type="submit" value="Submit"/>
</form>
<div id="console"></div>
<script>
description("This test performs a check for the :default CSS selector on multiple submit buttons, part 2.");

v = document.getElementsByName("victim");
shouldBe("document.defaultView.getComputedStyle(v[0], null).getPropertyValue('background-color')", "'rgb(0, 255, 0)'");
for (i = 1; i < v.length; i++)
    shouldBe("document.defaultView.getComputedStyle(v[i], null).getPropertyValue('background-color')", "'rgb(255, 0, 0)'");
</script>
</body>
</html>