blob: 952625c929d2478b09fe42aead9c4ade87b31b62 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<title>Test that we reject syntax errors listed in descriptor_database.js</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="descriptor_database.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
var gStyleElement = document.createElement("style");
gStyleElement.setAttribute("type", "text/css");
document.getElementsByTagName("head")[0].appendChild(gStyleElement);
var gSheet = gStyleElement.sheet;
gSheet.insertRule("@font-face { }", 0);
var gRule = gSheet.cssRules[0];
var gDeclaration = gRule.style;
function fake_set_property(descriptor, value) {
gSheet.deleteRule(0);
gSheet.insertRule("@font-face { " + descriptor + ": " + value + "}", 0);
gRule = gSheet.cssRules[0];
gDeclaration = gRule.style;
}
for (var descriptor in gCSSFontFaceDescriptors) {
var info = gCSSFontFaceDescriptors[descriptor];
for (var idx in info.invalid_values) {
var badval = info.invalid_values[idx];
// // We don't implement SetProperty yet (bug 443978).
// gDeclaration.setProperty(descriptor, badval, "");
fake_set_property(descriptor, badval);
is(gDeclaration.getPropertyValue(descriptor), "",
"invalid value '" + badval + "' not accepted for '" + descriptor +
"' descriptor");
gDeclaration.removeProperty(descriptor);
}
}
</script>
</pre>
</body>
</html>
|