[webkit-changes] [WebKit/WebKit] 7b94b0: RTL Tab handling is imperfect

Alan Baradlay noreply at github.com
Thu Jan 26 09:06:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7b94b0c936fbc00d03b223b2a49071b43d8e170d
      https://github.com/WebKit/WebKit/commit/7b94b0c936fbc00d03b223b2a49071b43d8e170d
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-01-26 (Thu, 26 Jan 2023)

  Changed paths:
    A LayoutTests/fast/inline/rtl-with-position-dependent-content-width-expected.html
    A LayoutTests/fast/inline/rtl-with-position-dependent-content-width.html
    M LayoutTests/platform/ios/fast/css/text-overflow-input-expected.txt
    M LayoutTests/platform/ios/fast/forms/input-text-scroll-left-on-blur-expected.txt
    M LayoutTests/platform/ios/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
    M LayoutTests/platform/ios/fast/text/international/rtl-white-space-pre-wrap-expected.txt
    M LayoutTests/platform/mac/fast/css/text-overflow-input-expected.txt
    M LayoutTests/platform/mac/fast/forms/input-text-scroll-left-on-blur-expected.txt
    M LayoutTests/platform/mac/fast/forms/search-rtl-expected.txt
    M LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
    M LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.txt
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp

  Log Message:
  -----------
  RTL Tab handling is imperfect
https://bugs.webkit.org/show_bug.cgi?id=250969
<rdar://problem/104528894>

Reviewed by Antti Koivisto.

As described in Line::appendTextContent, with position dependent character widths, unless we chop them for painting the same way we measure them at layout (i.e. measure whitespace/non-whitespace inline text items separately),
we may end up placing (painting) them at incorrect positions.
e.g. [ش][tab] in right-to-left context
  1. first we split the content into 2 dedicated inline items (non-whitespace[ش] and whitespace [tab]) and measure them individually.
  2. starting with the logically leading character [ش], followed by the trailing tab character. At this point the tab character has a non-zero x offset (assume [ش] is measured > 0).
  3. now at paint time if we attempt to paint these 2 characters as one joint TextRun ([ش][tab]), the visually leading [tab] now may produce a different advance width at position 0.

* LayoutTests/fast/inline/rtl-with-position-dependent-content-width-expected.html: Added.
* LayoutTests/fast/inline/rtl-with-position-dependent-content-width.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::appendTextContent):

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




More information about the webkit-changes mailing list