[webkit-changes] [WebKit/WebKit] a10f57: text-spacing: text-autospace: Fix computeInlineBox...
Vitor Roriz
noreply at github.com
Fri Aug 30 16:16:18 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a10f5772f6a2343c601e3a7982b193ec58641c5f
https://github.com/WebKit/WebKit/commit/a10f5772f6a2343c601e3a7982b193ec58641c5f
Author: Vitor Roriz <vitor.roriz at apple.com>
Date: 2024-08-30 (Fri, 30 Aug 2024)
Changed paths:
M Source/WebCore/layout/formattingContexts/inline/InlineContentCache.h
M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.h
Log Message:
-----------
text-spacing: text-autospace: Fix computeInlineBoxBoundaryTextSpacingsIfNeeded to operate on InlineItemList before cached
https://bugs.webkit.org/show_bug.cgi?id=278917
rdar://problem/135012026
Reviewed by Alan Baradlay.
This is yet another preparation patch for text-autospace implementation across element
boundaries.
At [1] we have implemented the Layout part of it, which we need to fix here:
InlineItemsBuilder::computeInlineBoxBoundaryTextSpacingsIfNeeded computes text spacing based on InlineItemList.
It currently uses the list cached as InlineContentCache, however, at that point in InlineItemsBuilder::build
we haven't yet cached such list. We need to use the list being prepared by ::build.
Our current HashMap for tracking such spacings (InlineBoxBoundaryTextSpacings) maps from Index to spacings.
Index can be 0 and in such cases HashMap needs traits for being able to differentiate between a empty key
and a 0-value key.
InlineBoxBoundaryTextSpacings maps using indexes of InlineStartBox on InlineItemList. This will be used
on future for moving the display box correspondent to the InlineStartBox to the "logical right". However,
during Layout we don't have a notion of placement yet, so we make this spacing contribute to the
InlineTextItem's width instead, since the InlineStartBox's width is currently not taken into consideration
during layout.
* Source/WebCore/layout/formattingContexts/inline/InlineContentCache.h:
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::build):
(WebCore::Layout::InlineItemsBuilder::computeInlineBoxBoundaryTextSpacingsIfNeeded):
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.h:
Canonical link: https://commits.webkit.org/282999@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list