Changeset 285826 in webkit
- Timestamp:
- Nov 15, 2021, 12:47:49 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
layout/formattingContexts/inline/InlineLine.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285823 r285826 1 2021-11-15 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Fix fast/text/letter-spacing-negative-opacity.html 4 https://bugs.webkit.org/show_bug.cgi?id=233132 5 6 Reviewed by Antti Koivisto. 7 8 Special case the negative letter spacing content when computing the content logical width. 9 10 * layout/formattingContexts/inline/InlineLine.cpp: 11 (WebCore::Layout::Line::appendTextContent): 12 1. Negative letter space value could produce negative content width 13 2. Subsequent text content (e.g. "this text has whitepspace content") may go from positive to negative content width as parts of the content may produce positive width even with negative letter spacing. 14 1 15 2021-11-15 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
r285160 r285826 343 343 auto contentLogicalRight = runLogicalLeft + logicalWidth + m_clonedEndDecorationWidthForInlineBoxRuns; 344 344 m_contentLogicalWidth = std::max(oldContentLogicalWidth, contentLogicalRight); 345 } else if (style.letterSpacing() >= 0) { 346 m_runs.last().expand(inlineTextItem, logicalWidth); 347 m_contentLogicalWidth += logicalWidth; 345 348 } else { 346 m_runs.last().expand(inlineTextItem, logicalWidth); 347 // Do not let negative letter spacing make the content shorter than it already is. 348 m_contentLogicalWidth += std::max(0.0f, logicalWidth); 349 auto& lastRun = m_runs.last(); 350 ASSERT(lastRun.isText()); 351 // Negative letter spacing should only shorten the content to the boundary of the previous run. 352 // FIXME: We may need to traverse all the way to the previous non-text run (or even across inline boxes). 353 auto lastRunLogicalWidth = lastRun.logicalWidth(); 354 auto contentWidthWithoutLastTextRun = m_contentLogicalWidth - std::max(0.f, lastRunLogicalWidth); 355 lastRun.expand(inlineTextItem, logicalWidth); 356 m_contentLogicalWidth = std::max(contentWidthWithoutLastTextRun, lastRunLogicalWidth + logicalWidth); 349 357 } 350 358
Note:
See TracChangeset
for help on using the changeset viewer.