[webkit-changes] [WebKit/WebKit] 9fac64: [LFC][IFC] Fix editing/inserting/inserting-trailin...

alan noreply at github.com
Wed Sep 28 07:26:26 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9fac64bb2d1299aa64a395be40149426e7d2a7b7
      https://github.com/WebKit/WebKit/commit/9fac64bb2d1299aa64a395be40149426e7d2a7b7
  Author: Alan Bujtas <zalan at apple.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M LayoutTests/platform/ios/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt
    M LayoutTests/platform/mac/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.h
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineTextItem.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineTextItem.h

  Log Message:
  -----------
  [LFC][IFC] Fix editing/inserting/inserting-trailing-space-and-letter.html
https://bugs.webkit.org/show_bug.cgi?id=245709

Reviewed by Antti Koivisto.

This patch completes (converts really) "-webkit-nbsp-mode: space" quirk implementation to support another quirk, "line-break: after-white-space".

&nbsp's behavior when "-webkit-nbsp-mode: space" is present as follows:
- intrinsic width computation: &nbsp character is included as is
- normal inline line layout:
  - no overflow: &nbsp character is included as is (no-collapse, no-trim).
  - overflow when "line-breaking" is not "after-white-space": no-collapse, remove the overflowing part of the &nbps sequence
  - overflow when "line-breaking" is "after-white-space": no-collapse, no-trim but reset the size of the overflowing part of the &nbps sequence to 0.
  - ignore all these "what if overflow" above when "white-space" is "pre" or "nowrap".
  - oh and slightly overflow/underflow (by one &nbsp) when "white-space" is "break-spaces" (not included in this patch).

(remove the old quirk implementation and replace it with to support ^^^)

* Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp:
(WebCore::Layout::InlineContentBreaker::ContinuousContent::resetTrailingWhitespace): leftover rename..

* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp: let's construct individual items for each &nbsp to make trim/remove simpler

* Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp:
(WebCore::Layout::Line::appendTextContent):
(WebCore::Layout::Line::initialize): remove old quirk

(WebCore::Layout::Line::handleOverflowingNonBreakingSpace): find the first index from where we go forward and trim/remove/adjust runs.

*fast/text/whitespace/nbsp-mode-and-linewraps.html: Dedicated runs. No visual change.

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




More information about the webkit-changes mailing list