2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / setPrimitiveValue.html
blob7bdbec0e74f29c7c12d8262becddb74407e7bf53
1 <html>
2 <head>
3 <style>
4 div.test {
5 position: absolute;
6 left: 250px;
7 top: 100px;
8 background-image: url(stars.gif);Ê
10 </style>
11 <script>
12 function runTest()
14 var helloText = document.getElementById("hello");
15 var positionField = document.getElementById("style position");
16 var position = 50.0;
18 var textRule = document.styleSheets[0].cssRules[0];
19 var s = textRule.style;
20 var leftValue = s.getPropertyCSSValue("left");
21 var bgImageValue = s.getPropertyCSSValue("background-image");
23 try
25 leftValue.setFloatValue(leftValue.primitiveType, parseFloat(position));
27 catch (e)
29 alert("setFloatValue " + e.message);
32 try
34 bgImageValue.setStringValue(bgImageValue.primitiveType, "stripes.gif");
36 catch (e)
38 alert("setStringValue " + e.message);
42 </script>
43 </head>
44 <body onload="runTest();">
45 This test checks that a primitive CSS values can be set without generating an exception.
46 <div class="test" id="hello">Hello world</div>
47 <pre id="console"></pre>
48 </body>
49 </html>