summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_bug798567.html
blob: b8e5dd0ea47ead2fa4f61a1c770f9785d00fdf5c (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
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=798567
-->
<head>
  <title>Test for Bug 798567</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
  <div id="some_div"  style="opacity: 0.5">bar</div>
  <div style="cursor: crosshair" id="div_cursor">foobar</div>
  <script type="application/javascript">
    var elm = document.getElementById("some_div");
    var cs = getComputedStyle(elm);
    var cssValue = cs.getPropertyCSSValue("opacity");
    is(cssValue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER), 0.5, "wrong opacity of some_div");

    elm = document.getElementById("div_cursor");
    cs = getComputedStyle(elm);
    cssValue = cs.getPropertyCSSValue("cursor");
    ok(cssValue[0], "element with set cursor should have a a computed style");
  </script>
</body>
</html>