Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 681c0a0ad8ad1cdcc78ee7d0ceded7bcc624ea86
      
https://github.com/WebKit/WebKit/commit/681c0a0ad8ad1cdcc78ee7d0ceded7bcc624ea86
  Author: Alan Baradlay <[email protected]>
  Date:   2026-09-08 (Tue, 08 Sep 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/reference/tab-stop-threshold-007-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-stop-threshold-007-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-stop-threshold-007.html
    M Source/WebCore/platform/graphics/FontCascadeInlines.h

  Log Message:
  -----------
  Tab character renders too narrow when tab-size is small (proportional fonts)
https://bugs.webkit.org/show_bug.cgi?id=323466
<rdar://problem/186698040>

Reviewed by Antti Koivisto.

    <div style="font: 32px serif; white-space: pre; tab-size: 
0.4ch">&#9;&#9;&#9;</div>

Each tab should advance to the second tab stop, making the run 2.4ch wide. 
Instead it advanced to the first one and the run was 1.2ch.

A tab is not a glyph but a shift to the next tab stop, and a shift too short to 
read as a tab takes the subsequent stop instead.
The spec measures "too short" against 0.5ch, half the advance of the "0" glyph, 
while we measured it against the space character.
In a proportional font the space is a lot narrower than the "0" (2.2px vs 4px 
in 16px Times)

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/reference/tab-stop-threshold-007-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-stop-threshold-007-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-stop-threshold-007.html:
 Added.
* Source/WebCore/platform/graphics/FontCascadeInlines.h:
(WebCore::FontCascade::tabWidth):

Canonical link: https://commits.webkit.org/320671@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to