blob: 7bdbec0e74f29c7c12d8262becddb74407e7bf53 [file] [log] [blame]
<html>
<head>
<style>
div.test {
position: absolute;
left: 250px;
top: 100px;
background-image: url(stars.gif);Ê
}
</style>
<script>
function runTest()
{
var helloText = document.getElementById("hello");
var positionField = document.getElementById("style position");
var position = 50.0;
var textRule = document.styleSheets[0].cssRules[0];
var s = textRule.style;
var leftValue = s.getPropertyCSSValue("left");
var bgImageValue = s.getPropertyCSSValue("background-image");
try
{
leftValue.setFloatValue(leftValue.primitiveType, parseFloat(position));
}
catch (e)
{
alert("setFloatValue " + e.message);
}
try
{
bgImageValue.setStringValue(bgImageValue.primitiveType, "stripes.gif");
}
catch (e)
{
alert("setStringValue " + e.message);
}
}
</script>
</head>
<body onload="runTest();">
This test checks that a primitive CSS values can be set without generating an exception.
<div class="test" id="hello">Hello world</div>
<pre id="console"></pre>
</body>
</html>