summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/shorthand-priority.html
blob: 9ae4a75d52dbf47ab752de802287f76edfe8f9e9 (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
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<script>

description("Tests that querying the priority for a shorthand works.");

var testContainer = document.createElement("div");
document.body.appendChild(testContainer);

testContainer.innerHTML = '<div id="test">hello</div>';

e = document.getElementById('test');

// Sanity check.
e.style.setProperty("border-bottom-style", "solid", "!important");
shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'");
shouldBe("e.style.getPropertyPriority('border-bottom-style')", "'important'");

e.style.borderBottomStyle = "";
e.style.border = "20px solid green";
shouldBe("e.style.getPropertyValue('border')", "'20px solid green'");
shouldBe("e.style.getPropertyPriority('border')", "''");

e.style.border = "";
e.style.setProperty("border", "20px solid green", "!important");
shouldBe("e.style.getPropertyValue('border')", "'20px solid green'");
shouldBe("e.style.getPropertyPriority('border')", "'important'");

document.body.removeChild(testContainer);
</script>
</body>
</html>