2007-04-15 15:29:35 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test that we reject syntax errors listed in property_database.js</title>
|
|
|
|
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript" src="property_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 id="testnode"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
|
|
|
var gDeclaration = document.getElementById("testnode").style;
|
|
|
|
|
2007-04-16 18:07:22 -07:00
|
|
|
var gKnownFails = {
|
|
|
|
"pitch-range": [ " -0.01", "100.2", "108", "-3" ],
|
|
|
|
"richness": [ " -0.01", "100.2", "108", "-3" ],
|
|
|
|
"stress": [ " -0.01", "100.2", "108", "-3" ],
|
2008-12-23 06:06:58 -08:00
|
|
|
"volume": [ " -0.01", "100.2", "108", "-3" ]
|
2007-04-16 18:07:22 -07:00
|
|
|
}
|
|
|
|
|
2007-04-15 15:29:35 -07:00
|
|
|
for (var property in gCSSProperties) {
|
|
|
|
var info = gCSSProperties[property];
|
|
|
|
for (var idx in info.invalid_values) {
|
|
|
|
var badval = info.invalid_values[idx];
|
|
|
|
|
|
|
|
gDeclaration.setProperty(property, badval, "");
|
|
|
|
|
2007-04-16 18:07:22 -07:00
|
|
|
var func = is;
|
|
|
|
if (property in gKnownFails &&
|
|
|
|
gKnownFails[property].indexOf(badval) != -1)
|
|
|
|
func = todo_is;
|
|
|
|
|
|
|
|
func(gDeclaration.getPropertyValue(property), "",
|
|
|
|
"invalid value '" + badval + "' not accepted for '" + property +
|
|
|
|
"' property");
|
2007-04-15 15:29:35 -07:00
|
|
|
|
|
|
|
if ("subproperties" in info) {
|
|
|
|
for (var sidx in info.subproperties) {
|
|
|
|
var subprop = info.subproperties[sidx];
|
2007-04-16 18:07:22 -07:00
|
|
|
func(gDeclaration.getPropertyValue(subprop), "",
|
|
|
|
"invalid value '" + badval + "' not accepted for '" + property +
|
|
|
|
"' property when testing subproperty '" + subprop + "'");
|
2007-04-15 15:29:35 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gDeclaration.removeProperty(property);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|