wpt / css / css-values / calc-positive-fraction-001.html

Status: PASS | Duration: 8ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-values/calc-positive-fraction-001.html

<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CSS Test: calc() with positive fraction halfway between adjacent integers</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
  <link rel="help" href="https://www.w3.org/TR/css-values-4/#combine-integers">
  <link rel="match" href="../reference/ref-filled-green-100px-square.xht">

  <style>
  div
    {
      height: 100px;
      position: absolute;
      width: 100px;
    }

  div#red-overlapped
    {
      background-color: red;
      z-index: 2;
    }

  div#green-overlapping
    {
      background-color: green;
      z-index: calc(3 / 2);
      /*
      should resolve to 'z-index: 2' since "values
      halfway between adjacent integers rounded
      towards positive infinity" and since
      div#green-overlapping is last in document
      tree order, then it should overlap
      div#red-overlapped
      */
    }
  </style>

  <p>Test passes if there is a filled green square and <strong>no red</strong>.

  <div id="red-overlapped"></div>

  <div id="green-overlapping"></div>

/css/reference/ref-filled-green-100px-square.xht

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>CSS Reftest Reference</title>
  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
  <style type="text/css"><![CDATA[
  div
  {
  background-color: green;
  height: 100px;
  width: 100px;
  }
  ]]></style>
 </head>
 <body>
  <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
  <div></div>
 </body>
</html>