Skip to content

CSS 3D transforms cut along the compositor borders #8329

Closed

Description

@paulrouget

s

<style>
  div {
    background: #f06;
    top: calc(50vh - 100px);
    left: calc(50vw - 100px);
    height: 200px;
    width: 200px;
    position: absolute;
  }
</style>

<body>
  <div></div>
</body>

<script>

  const cssGimbal = (x, y, z, rx, ry, rz) => `translate3d(${x}px, ${y}px, ${z}px) rotateX(${rx}deg) rotateY(${ry}deg) rotateZ(${rz}deg)`;

  var div = document.querySelector('div');
  var t = 0;
  setInterval(() => {
    t += 0.05;
    x = 1000 * Math.cos(t);
    y = 1000 * Math.sin(t);
    div.style.transform = cssGimbal(
      (x * -0.02),
      (y * -0.07),
      -400,
      (-1 * (y * 0.02)),
      (x * 0.02),
      0
    );
  }, 20);
</script>

Activity

  1. glennw commented on Nov 12, 2015

    @glennw
    Member

    This only seems to occur when device-pixel-ratio=2 (which is set automatically when running on a retina screen on mac) so hopefully it's something fairly simple - I'll look into it further tomorrow. This test also runs correctly on the webrender branch with a much better frame rate too :)

  2. glennw commented on Nov 17, 2015

    @glennw
    Member

    It seems that the device pixel ratio is a red herring - it happens to make it work in this case, but only by chance. The main issue appears to be how the DL optimizer handles intersecting tiles with transformed stacking contexts. Still looking into it.

  3. added 2 commits that reference this issue on Nov 17, 2015
    f35bc25
    f555e38
  4. added a commit that references this issue on Nov 20, 2015
    c19b01c
  5. added a commit that references this issue on Nov 25, 2015
    5b158ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions