[Webkit-unassigned] [Bug 3676] MIR Image replacement technique (negative letter-spacing) does not always work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 28 21:23:41 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=3676

--- Comment #15 from zalan <zalan at apple.com> ---
Created attachment 464241

  --> https://bugs.webkit.org/attachment.cgi?id=464241&action=review

Test case screenshot

This fixes both test cases.

diff --git a/Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp b/Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
index a1d927521680..7d84517d22cd 100644
--- a/Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
+++ b/Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
@@ -403,7 +403,8 @@ void Line::appendInlineBoxEnd(const InlineItem& inlineItem, const RenderStyle& s
     // https://drafts.csswg.org/css-text-3/#letter-spacing-property See example 21.
     removeTrailingLetterSpacing();
     m_contentLogicalWidth -= removeBorderAndPaddingEndForInlineBoxDecorationClone(inlineItem);
-    auto logicalLeft = lastRunLogicalRight();
+    // Negative letter spacing should only shorten the content to the boundary of the previous run.
+    auto logicalLeft = style.letterSpacing() < 0 ? m_contentLogicalWidth : lastRunLogicalRight();
     m_runs.append({ inlineItem, style, logicalLeft, logicalWidth });
     // Do not let negative margin make the content shorter than it already is.
     m_contentLogicalWidth = std::max(m_contentLogicalWidth, logicalLeft + logicalWidth);

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221229/b17f5144/attachment-0001.htm>


More information about the webkit-unassigned mailing list