Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: beff8758f9a09b5ad663f3bf9454ed47c2b87d57
      
https://github.com/WebKit/WebKit/commit/beff8758f9a09b5ad663f3bf9454ed47c2b87d57
  Author: Alan Baradlay <[email protected]>
  Date:   2025-10-16 (Thu, 16 Oct 2025)

  Changed paths:
    A LayoutTests/fast/text/pre-with-wrapping-and-tabs-expected.html
    A LayoutTests/fast/text/pre-with-wrapping-and-tabs.html
    M Source/WebCore/layout/formattingContexts/inline/AbstractLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/AbstractLineBuilder.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M 
Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h

  Log Message:
  -----------
  Jupyter notebook with long lines of result text hangs for multiple minutes
https://bugs.webkit.org/show_bug.cgi?id=300907
<rdar://162695099>

Reviewed by Antti Koivisto.

This Jupyter notebook has a slightly uncommon content which is a mixture of
- preserved whitespace content (<pre>)
- inside a flexing container
- with arbitrary breaking positions (word-break: break-all)

and with tons of whitespace characters (like hundreds of thousands).

When we break a word at an arbitrary position, we retain the overflowing width 
and feed it
back to the subsequent line as the leading inline item's width. It ensures that 
we don't
end up measuring content multiple times (see overflowWidthAsLeadingForNextLine).

This optimization ignores whitespace content as normally when we are allowed to 
break
words, whitespace content is also collapsed (or at least relatively small in 
size).

This change ensure we include whitespace content when retaining overflowing 
trailing width as
leading width, just have to make sure that we recognize when the whitespace 
content has
position dependent sizing (since in such cases we do have to re-measure the 
content).

Test: fast/text/pre-with-wrapping-and-tabs.html

* LayoutTests/fast/text/pre-with-wrapping-and-tabs-expected.html: Added.
* LayoutTests/fast/text/pre-with-wrapping-and-tabs.html: Added.
* Source/WebCore/layout/formattingContexts/inline/AbstractLineBuilder.cpp:
(WebCore::Layout::AbstractLineBuilder::overflowWidthAsLeadingForNextLine const):
(WebCore::Layout::AbstractLineBuilder::eligibleOverflowWidthAsLeading const): 
Deleted.
* Source/WebCore/layout/formattingContexts/inline/AbstractLineBuilder.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::processLineBreakingResult):
* Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.cpp:
(WebCore::Layout::TextOnlySimpleLineBuilder::handleOverflowingTextContent):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to