44 lines
1.4 KiB
HTML
44 lines
1.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
<html>
|
|
<head>
|
|
<script src="../../resources/js-test-pre.js"></script>
|
|
</head>
|
|
<body>
|
|
<p id="description"></p>
|
|
<div id="console"></div>
|
|
<script>
|
|
description("Test the parsing of box-shadow.");
|
|
|
|
// These have to be global for the test helpers to see them.
|
|
var stylesheet, cssRule, declaration;
|
|
var styleElement = document.createElement("style");
|
|
document.head.appendChild(styleElement);
|
|
stylesheet = styleElement.sheet;
|
|
|
|
function testInvalidFilterRule(description, rule)
|
|
{
|
|
debug("");
|
|
debug(description + " : " + rule);
|
|
|
|
stylesheet.insertRule("body { box-shadow: " + rule + "; }", 0);
|
|
cssRule = stylesheet.cssRules.item(0);
|
|
|
|
shouldBe("cssRule.type", "1");
|
|
|
|
declaration = cssRule.style;
|
|
shouldBe("declaration.length", "0");
|
|
shouldBeEqualToString("declaration.getPropertyValue('box-shadow')", "");
|
|
}
|
|
|
|
// FIXME A whole bunch of negative parsing tests are missing, see bug
|
|
// http://webkit.org/b/111498
|
|
testInvalidFilterRule("Negative blur radius value", "10px 10px -1px rgb(255, 0, 0)");
|
|
testInvalidFilterRule("Negative blur radius value, with a spread defined", "10px 10px -1px 10px rgb(255, 0, 0)");
|
|
testInvalidFilterRule("Negative blur radius value, with a negative spread defined", "10px 10px -1px -1px rgb(255, 0, 0)");
|
|
|
|
successfullyParsed = true;
|
|
</script>
|
|
<script src="../../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|