summaryrefslogtreecommitdiffstats
path: root/layout/style/test/style_attribute_tests.js
blob: be24baf954e29b717d7949ea397776092447b979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

SimpleTest.waitForExplicitFinish();

window.addEventListener("load", runTests, false);

function runTests(event)
{
    if (event.target != document) {
        return;
    }

    var elt = document.getElementById("content");

    elt.setAttribute("style", "color: blue; background-color: fuchsia");
    is(elt.style.color, "blue",
       "setting correct style attribute (color)");
    is(elt.style.backgroundColor, "fuchsia",
       "setting correct style attribute (color)");

    elt.setAttribute("style", "{color: blue; background-color: fuchsia}");
    is(elt.style.color, "",
       "setting braced style attribute (color)");
    is(elt.style.backgroundColor, "",
       "setting braced style attribute (color)");

    SimpleTest.finish();
}