summaryrefslogtreecommitdiffstats
path: root/layout/style/test/style_attribute_tests.js
blob: 243ec3380d33792ab16bb13d6c61fd29728e0be6 (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
SimpleTest.waitForExplicitFinish();

window.addEventListener("load", runTests);

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();
}