1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/test/style_attribute_tests.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,27 @@ 1.4 + 1.5 +SimpleTest.waitForExplicitFinish(); 1.6 + 1.7 +window.addEventListener("load", runTests, false); 1.8 + 1.9 +function runTests(event) 1.10 +{ 1.11 + if (event.target != document) { 1.12 + return; 1.13 + } 1.14 + 1.15 + var elt = document.getElementById("content"); 1.16 + 1.17 + elt.setAttribute("style", "color: blue; background-color: fuchsia"); 1.18 + is(elt.style.color, "blue", 1.19 + "setting correct style attribute (color)"); 1.20 + is(elt.style.backgroundColor, "fuchsia", 1.21 + "setting correct style attribute (color)"); 1.22 + 1.23 + elt.setAttribute("style", "{color: blue; background-color: fuchsia}"); 1.24 + is(elt.style.color, "", 1.25 + "setting braced style attribute (color)"); 1.26 + is(elt.style.backgroundColor, "", 1.27 + "setting braced style attribute (color)"); 1.28 + 1.29 + SimpleTest.finish(); 1.30 +}