summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/cssText-cache.html
blob: cc8ef92eac23e21e076d4d8f0fee1e05ddf3bcb0 (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
28
29
30
<body>
<div id="box">
</div>
<div id="results">
</div>
<script type="text/javascript" charset="utf-8">

  if (window.testRunner)
    testRunner.dumpAsText();

  var style = document.getElementById('box').style;

  style.left = "10px";
  checkResult("style.left", "10px");
  style.left = "20px";
  checkResult("style.left", "20px");

  function checkResult(property, expectedValue) {
    var value = eval(property);
    var result = ": " + property + " was " + value + ", expected " + expectedValue + "<br>";
    if (value == expectedValue)
      result = "<b style=\"color:green\">PASS</b>" + result;
    else
      result = "<b style=\"color:red\">FAIL</b>" + result;
    var results = document.getElementById('results');
    results.innerHTML += result;
  }

</script>
</body>