6 var item
= document
.createElement("li");
7 item
.appendChild(document
.createTextNode(message
));
8 document
.getElementById("console").appendChild(item
);
10 function setInitialStyleForE()
12 var e
= document
.getElementById('e');
16 e
.style
.display
= "none";
17 e
.style
.bottom
= "1px";
21 if (window
.testRunner
)
22 testRunner
.dumpAsText();
24 var e
= document
.getElementById('e');
26 setInitialStyleForE();
28 e
.style
.display
= "block";
29 log("Successfully set display to \"block\"; cssText is now: \"" + e
.style
.cssText
+ "\".");
31 log("Got exception trying to set display to \"block\"; cssText is now: \"" + e
.style
.cssText
+ "\".");
34 setInitialStyleForE();
36 e
.style
.display
= "foobar";
37 log("Successfully set display to \"foobar\"; cssText is now: \"" + e
.style
.cssText
+ "\".");
39 log("Got exception trying to set display to \"foobar\"; cssText is now: \"" + e
.style
.cssText
+ "\".");
42 setInitialStyleForE();
45 log("Successfully set display to \"\"; cssText is now: \"" + e
.style
.cssText
+ "\".");
47 log("Got exception trying to set display to \"\"; cssText is now: \"" + e
.style
.cssText
+ "\".");
50 setInitialStyleForE();
52 e
.style
.display
= null;
53 log("Successfully set display to null; cssText is now: \"" + e
.style
.cssText
+ "\".");
55 log("Got exception trying to set display to null; cssText is now: \"" + e
.style
.cssText
+ "\".");
58 setInitialStyleForE();
60 e
.style
.setProperty("display", "block", "");
61 log("Successfully set display to \"block\" with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
63 log("Got exception trying to set display to \"block\" with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
66 setInitialStyleForE();
68 e
.style
.setProperty("display", "foobar", "");
69 log("Successfully set display to \"foobar\" with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
71 log("Got exception trying to set display to \"foobar\" with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
74 setInitialStyleForE();
76 e
.style
.setProperty("display", "", "");
77 log("Successfully set display to \"\" with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
79 log("Got exception trying to set display to \"\" with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
82 setInitialStyleForE();
84 e
.style
.setProperty("display", null, "");
85 log("Successfully set display to null with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
87 log("Got exception trying to set display to null with setProperty; cssText is now: \"" + e
.style
.cssText
+ "\".");
92 <body onload=
"test();">
93 <p>Test for
<a href=
"http://bugs.webkit.org/show_bug.cgi?id=7296">bug
7296</a>.
</p>
94 <p>This test checks to see whether you get exceptions when setting a property with a
"bad value".
95 Setting using JavaScript property syntax and with setProperty() should behave the same.
</p>
96 <P>It is OK if the order of properties changes from the expected results - IE
6 and Firefox
2 don't agree on it anyway.
</p>
98 <p id=
"e">This is the test element.
</p>
100 <ol id=
"console"></ol>