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="/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>
|
2012-07-16 06:11:33 -07:00
|
|
|
<body onload="run()">
|
2007-04-15 15:29:35 -07:00
|
|
|
<p id="display"></p>
|
2012-07-16 06:11:33 -07:00
|
|
|
<iframe id="quirks" src="data:text/html,<div id='testnode'></div>"></iframe>
|
2007-04-15 15:29:35 -07:00
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
<div id="testnode"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
2012-07-16 06:11:33 -07:00
|
|
|
SimpleTest.waitForExplicitFinish();
|
2007-04-15 15:29:35 -07:00
|
|
|
|
2012-07-16 06:11:33 -07:00
|
|
|
function check_not_accepted(decl, property, info, badval)
|
|
|
|
{
|
|
|
|
decl.setProperty(property, badval, "");
|
|
|
|
|
|
|
|
is(decl.getPropertyValue(property), "",
|
|
|
|
"invalid value '" + badval + "' not accepted for '" + property +
|
|
|
|
"' property");
|
|
|
|
|
|
|
|
if ("subproperties" in info) {
|
|
|
|
for (var sidx in info.subproperties) {
|
|
|
|
var subprop = info.subproperties[sidx];
|
|
|
|
is(decl.getPropertyValue(subprop), "",
|
|
|
|
"invalid value '" + badval + "' not accepted for '" + property +
|
|
|
|
"' property when testing subproperty '" + subprop + "'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
decl.removeProperty(property);
|
2007-04-16 18:07:22 -07:00
|
|
|
}
|
|
|
|
|
2012-07-16 06:11:33 -07:00
|
|
|
function run()
|
|
|
|
{
|
|
|
|
var gDeclaration = document.getElementById("testnode").style;
|
|
|
|
var gQuirksDeclaration = document.getElementById("quirks").contentDocument
|
|
|
|
.getElementById("testnode").style;
|
2007-04-15 15:29:35 -07:00
|
|
|
|
2012-07-16 06:11:33 -07:00
|
|
|
for (var property in gCSSProperties) {
|
|
|
|
var info = gCSSProperties[property];
|
|
|
|
for (var idx in info.invalid_values) {
|
|
|
|
check_not_accepted(gDeclaration, property, info,
|
|
|
|
info.invalid_values[idx]);
|
|
|
|
check_not_accepted(gQuirksDeclaration, property, info,
|
|
|
|
info.invalid_values[idx]);
|
|
|
|
}
|
2012-07-15 22:10:06 -07:00
|
|
|
|
2012-07-16 06:11:33 -07:00
|
|
|
if ("quirks_values" in info) {
|
|
|
|
for (var quirkval in info.quirks_values) {
|
|
|
|
var standardval = info.quirks_values[quirkval];
|
|
|
|
check_not_accepted(gDeclaration, property, info, quirkval);
|
2012-07-15 22:10:06 -07:00
|
|
|
|
2012-07-16 06:11:33 -07:00
|
|
|
gQuirksDeclaration.setProperty(property, quirkval, "");
|
|
|
|
gDeclaration.setProperty(property, standardval, "");
|
|
|
|
var quirkret = gQuirksDeclaration.getPropertyValue(property);
|
|
|
|
var standardret = gDeclaration.getPropertyValue(property);
|
|
|
|
isnot(quirkret, "", property + ": " + quirkval +
|
|
|
|
" should be accepted in quirks mode");
|
|
|
|
is(quirkret, standardret, property + ": " + quirkval + " result");
|
|
|
|
|
|
|
|
if ("subproperties" in info) {
|
|
|
|
for (var sidx in info.subproperties) {
|
|
|
|
var subprop = info.subproperties[sidx];
|
|
|
|
var quirksub = gQuirksDeclaration.getPropertyValue(subprop);
|
|
|
|
var standardsub = gDeclaration.getPropertyValue(subprop);
|
|
|
|
isnot(quirksub, "", property + ": " + quirkval +
|
|
|
|
" should be accepted in quirks mode" +
|
|
|
|
" when testing subproperty " + subprop);
|
|
|
|
is(quirksub, standardsub, property + ": " + quirkval + " result" +
|
|
|
|
" when testing subproperty " + subprop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gQuirksDeclaration.removeProperty(property);
|
|
|
|
gDeclaration.removeProperty(property);
|
2007-04-15 15:29:35 -07:00
|
|
|
}
|
|
|
|
}
|
2012-07-16 01:04:31 -07:00
|
|
|
}
|
2012-07-16 06:11:33 -07:00
|
|
|
|
|
|
|
SimpleTest.finish();
|
2007-04-15 15:29:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|