Skip to content

Subpixel positioning fails since ac5525a #8166

Closed

Description

@paulrouget

When an iframe is present in the document, top:0.5px is drawn at 1px.

It's started with ac5525a.

<style>

  div {
    position: absolute;
    left: 0;
    top: 10.5px;
    width: 200px;
    height: 200px;
    background: red;
  }

  iframe {
    border: none;
  }

  .foo { display: none; }

</style>

<script>
  setInterval(() => {
    document.querySelector('iframe').classList.toggle('foo');
  }, 1000);
</script>

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

Activity

  1. paulrouget commented on Oct 23, 2015

    @paulrouget
    ContributorAuthor
  2. paulrouget commented on Oct 23, 2015

    @paulrouget
    ContributorAuthor

    Using to_nearest_pixel instead of to_nearest_px in components/gfx/paint_task.rs appears to solve the issue. I'll submit a PR.

  3. paulrouget commented on Oct 23, 2015

    @paulrouget
    ContributorAuthor

    I don't know how to get the pixel density in build_layer_properties. Usually, we use page_rect and screen_screen, but here, I don't know how to get this info.

  4. mrobinson commented on Oct 27, 2015

    @mrobinson
    Member

    I think one issue here is that the layer boundaries are rounded instead of expanded to pixel boundaries. I have a fix for this which depends on servo/app_units#3 (though I don't have a readily accessible hidpi screen to test it on).

  5. glennw commented on Oct 27, 2015

    @glennw
    Member

    @mrobinson Depending on what you're testing, you may be able to use --device-pixel-ratio=2 even on a non-hidpi monitor to test with.

  6. added 2 commits that reference this issue on Oct 29, 2015
    3f9084e
    a7a58e4
  7. added a commit that references this issue on Oct 29, 2015
    94ca87e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions