Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4fe7edf445642c9088b5658061d15101f5dcb278
      
https://github.com/WebKit/WebKit/commit/4fe7edf445642c9088b5658061d15101f5dcb278
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-06 (Wed, 06 May 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-position-with-text-align-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-position-with-text-align-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-position-with-text-align.html
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M 
Source/WebCore/layout/integration/inline/InlineIteratorBoxModernPathInlines.h

  Log Message:
  -----------
  REGRESSION(311971@main): Fix 
imported/w3c/web-platform-tests/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre.html
https://bugs.webkit.org/show_bug.cgi?id=314141
<rdar://176312224>

Reviewed by Antti Koivisto.

Tab stops are at fixed positions from the containing block's content box edge.
During line building, the tab width is computed without the text-align offset
(centering happens after). But during painting, the TextRun's xPos included
the centering offset, making the font code compute a different tab width.

Three things can shift inline content horizontally, and they work differently:

  - text-indent: shifts the line rect. Root inline box stays at 0 within it.
  - intrusive float: shifts the line rect. Root inline box stays at 0 within it.
  - text-align: line rect stays. Root inline box shifts within it 
(contentLogicalLeft).

Only text-indent and float offsets affect tab stop positions. text-align is a
visual shift of the entire line that doesn't change where tab stops fall.

The fix subtracts contentLogicalLeft (the text-align offset) from the xPos so
painting sees the same position that line building used.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-position-with-text-align-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-position-with-text-align-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/tab-position-with-text-align.html:
 Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/layout/integration/inline/InlineIteratorBoxModernPathInlines.h:
(WebCore::InlineIterator::BoxModernPath::textRun const):

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



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

Reply via email to