Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bc5840857156145683b382525da9e0c62aa9c45c
https://github.com/WebKit/WebKit/commit/bc5840857156145683b382525da9e0c62aa9c45c
Author: Ahmad Saleem <[email protected]>
Date: 2026-10-05 (Mon, 05 Oct 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
Log Message:
-----------
[IFC] Avoid allocating a String per text item when computing inline box
boundary text spacing
https://bugs.webkit.org/show_bug.cgi?id=326190
rdar://189072943
Reviewed by Alan Baradlay.
InlineTextBox::content() returns a const String&, so calling substring() on it
calls String::substring(), which allocates a new StringImpl and copies the
characters for every InlineTextItem. It only skips the copy when the item starts
at offset 0 and covers the whole string. The result is only passed to
TextUtil::lastBaseCharacterFromText(), which takes a StringView, so a view over
the existing content is enough.
No new tests, no change in behavior.
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::computeInlineBoxBoundaryTextSpacings):
Canonical link: https://commits.webkit.org/322749@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications