[webkit-changes] [WebKit/WebKit] f83971: [IFC] Hyphenation does not work across renderers

Alan Baradlay noreply at github.com
Tue May 23 10:36:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f839715515caca643c81d38f0b2ff45956539dab
      https://github.com/WebKit/WebKit/commit/f839715515caca643c81d38f0b2ff45956539dab
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-05-23 (Tue, 23 May 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/fast/inline/hyphen-across-renderers-expected.html
    A LayoutTests/fast/inline/hyphen-across-renderers.html
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp

  Log Message:
  -----------
  [IFC] Hyphenation does not work across renderers
https://bugs.webkit.org/show_bug.cgi?id=257109

Reviewed by Antti Koivisto.

When a hyphenation candidate word is split across multiple renderers (e.g. JS construct them
individually, or float/out-of-flow content gets in-between them), we only try to hyphenate
the individual inline items but not the complete word.

e.g.

  high<div style="position: absolute"></div>way

produces the following in-flow inline items with no soft wrap opportunities in-between them

  [high][way]

and if this content overflows (let's say after 'w'), we try to hyphenate [high]
but not [highway].

This patch ensures we pass in a concatenated version of such adjacent content to hyphenation.

* LayoutTests/TestExpectations:
* LayoutTests/fast/inline/hyphen-across-renderers-expected.html: Added.
* LayoutTests/fast/inline/hyphen-across-renderers.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.cpp:
(WebCore::Layout::InlineContentBreaker::processOverflowingContent const):
(WebCore::Layout::InlineContentBreaker::tryBreakingPreviousNonOverflowingRuns const):
(WebCore::Layout::InlineContentBreaker::tryHyphenationAcrossOverflowingInlineTextItems const):
(WebCore::Layout::InlineContentBreaker::processOverflowingContentWithText const):
* Source/WebCore/layout/formattingContexts/inline/InlineContentBreaker.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::commitPartialContent):

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




More information about the webkit-changes mailing list