<html lang="en">
<head>
  <script type="text/javascript" charset="utf-8">
      function doTest()
      {
          var bg = document.querySelector(".test");
          if (window.testRunner)
              testRunner.dumpAsText(true);

          // Change the layer to become background only.
          if (window.testRunner)
              window.testRunner.display();
          bg.innerHTML = "";
          if (window.testRunner)
              testRunner.notifyDone();
      }

      if (window.testRunner)
          testRunner.waitUntilDone();

      window.addEventListener('load', doTest, false);
    </script>
    <style>
    .composited { -webkit-transform: rotate3d(0, 0, 1, 0); }
    .test {
      height: 200px;
      width: 260px;
      background-image: url(../resources/simple_image.png);
    }
   </style>
</head>
<body>
  <div class="test composited">123</div>
</body>
</html>
