[Webkit-unassigned] [Bug 226819] New: Inaccurate background-size with ch units

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 9 08:06:37 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=226819

            Bug ID: 226819
           Summary: Inaccurate background-size with ch units
           Product: WebKit
           Version: Safari 14
          Hardware: Mac (Intel)
                OS: macOS 11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: g.vajda at me.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

Created attachment 430966

  --> https://bugs.webkit.org/attachment.cgi?id=430966&action=review

Inaccurate background layout in Safari

The issue is demonstrated here: https://codepen.io/vajdagabor/pen/VwpBRQG

I'm trying to create a (monospace) code display with repeated background pattern, where background-image is positioned precisely to every character. Setting background-size with ch unit would be ideal, but the result is inaccurate on Safari. The example works well on Chrome and Firefox.

Also, the pattern in the example is not visible when the font is small.

This is the CSS:

pre {
  background-image: linear-gradient(to right, black 0%, black 1px, transparent 1px, transparent 100%);
  background-size: 1ch;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210609/5f40a0c5/attachment.htm>


More information about the webkit-unassigned mailing list