summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-values/update-subpixel-rem-unit.html
blob: 98d4f00f92ae90165dd9b0c82cf0496523bc9c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!doctype html>
<html style="font-size:16px">
<head>
  <title>CSS Values and Units Test: rem subpixel change</title>
  <link rel="help" href="https://drafts.csswg.org/css-values/#rem">
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
</head>
<body>
  <div style="font-size:16px">
  <div id="remElement" style="width: 10rem"></div>
  </div>
  <script>
    test(() => {
      assert_equals(getComputedStyle(remElement).width, "160px");
      document.documentElement.style.fontSize = "16.1px";
      assert_equals(getComputedStyle(remElement).width, "161px");
    }, "Check that a 0.1px change in root font-size affect rem units.");
  </script>
<body>
</html>