Skip to content

Underlines less than 1px high are sometimes invisible due to rounding #7152

Closed

Description

@mbrubeck

In the test case below, about a third of the list items are painted with no visible underline. The display list items for the missing underlines look like this:

Rect(28px×0.6833333333333333px at (48px,255.78333333333333px))

This rect is invisible after rounding because its top and bottom coordinates (255.7833px and 256.4667px) both round to the same whole pixel value (256px).

This test case reproduces the bug on my Linux box, though the behavior varies depending on the exact fonts installed in the system. Zooming in or out can cause the bug to appear or disappear, depending again on the font.

<html>
  <head>
    <style>
      li {
        font: 14px "Times New Roman";
        text-decoration: underline;
      }
    </style>
  </head>
  <body>
    <ul>
      <li>Hello</li> <li>Hello</li> <li>Hello</li> <li>Hello</li>
      <li>Hello</li> <li>Hello</li> <li>Hello</li> <li>Hello</li>
      <li>Hello</li> <li>Hello</li> <li>Hello</li> <li>Hello</li>
      <li>Hello</li> <li>Hello</li> <li>Hello</li> <li>Hello</li>
      <li>Hello</li> <li>Hello</li> <li>Hello</li> <li>Hello</li>
    </ul>
  </body>
</html>

Activity

  1. added
    I-wrong
    on Aug 11, 2015
  2. self-assigned this
    on Aug 11, 2015
  3. added 3 commits that reference this issue on Aug 11, 2015
    e23b483
    0a1846c
    80e59cc
  4. added a commit that references this issue on Aug 11, 2015
    854a842
  5. added a commit that references this issue on Aug 11, 2015
    3b6dc09
  6. added a commit that references this issue on Aug 11, 2015
    9c528c6
  7. added a commit that references this issue on Aug 14, 2015
    057e309
  8. added 2 commits that reference this issue on Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-layout/textI-wrong

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions