summaryrefslogtreecommitdiffstats
path: root/dom/base/test/variable_style_sheet.sjs
blob: 8e4848a7f45b431cddf9bd24c393af3cff0ed45d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function handleRequest(request, response) {
  response.setHeader("Cache-Control", "no-cache", false);
  response.setHeader("Content-Type", "text/css", false);

  var accessCount;
  var state = getState("varSSAccessCount");
  if (!state) {
    setState("varSSAccessCount", "0");
    accessCount = 0;
  } else {
    setState("varSSAccessCount", (parseInt(state) + 1).toString());
    accessCount = parseInt(state) + 1;
  }

  response.write(
    "#content { background-color: rgb(" + (accessCount % 256) + ", 0, 0); }"
  );
}