| function print(message, color) |
| var paragraph = document.createElement("div"); |
| paragraph.appendChild(document.createTextNode(message)); |
| paragraph.style.fontFamily = "monospace"; |
| paragraph.style.color = color; |
| document.getElementById("console").appendChild(paragraph); |
| print("PASS: " + a + " should be " + b + " and is.", "green"); |
| print("FAIL: " + a + " should be " + b + " but instead is " + evalA + ".", "red"); |
| shouldBe("document.body.style.background == 'green'", true); |
| shouldBe("document.getElementById('div1').style.background == ''", true); |
| shouldBe("document.getElementById('div2').style.background == '50% 50% blue'", true); |
| shouldBe("document.getElementById('div3').style.background == 'none repeat scroll rgb(255, 255, 255)'", true); |
| <body onload="test();" style="background: green; color:white"> |
| <div id="div1" style="background-repeat: repeat-x, repeat-y; background-color:white"></div> |
| <div id="div2" style="background: 50% 50% blue"></div> |
| <div id="div3" style="background: rgb(255, 255, 255) none repeat scroll"></div> |
| <p>This page tests whether or not the background shorthand properly omits |
| <div id='console' style="background-color:white; border:2px solid black"></div> |