Changeset 283440 in webkit
- Timestamp:
- Oct 2, 2021, 6:34:43 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
layout/formattingContexts/inline/InlineLineBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r283439 r283440 1 2021-10-02 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Do not reuse the overflowing width on the next line when first line style is different 4 https://bugs.webkit.org/show_bug.cgi?id=231107 5 6 Reviewed by Antti Koivisto. 7 8 Let's compute the leading text content width at the next line (instead of reusing the overflowing trailing width), when the first line style is present and font-cascades differ. 9 10 * layout/formattingContexts/inline/InlineLineBuilder.cpp: 11 (WebCore::Layout::LineBuilder::handleInlineContent): 12 1 13 2021-10-02 Ziran Sun <zsun@igalia.com> 2 14 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
r283275 r283440 726 726 if (inlineTextItem.isWhitespace()) 727 727 return { }; 728 auto& overflowingRun = candidateRuns.first(); 729 if (m_isFirstLine) { 730 auto& usedStyle = overflowingRun.style; 731 auto& style = overflowingRun.inlineItem.style(); 732 if (&usedStyle != &style && usedStyle.fontCascade() != style.fontCascade()) { 733 // We may have the incorrect text width when styles differ. Just re-measure the text content when we place it on the next line. 734 return { }; 735 } 736 } 737 auto logicalWidthForNextLineAsLeading = overflowingRun.logicalWidth; 728 738 if (result.action == InlineContentBreaker::Result::Action::Wrap) 729 return candidateRuns.first().logicalWidth;739 return logicalWidthForNextLineAsLeading; 730 740 if (result.action == InlineContentBreaker::Result::Action::Break && result.partialTrailingContent->partialRun) 731 return candidateRuns.first().logicalWidth- result.partialTrailingContent->partialRun->logicalWidth;741 return logicalWidthForNextLineAsLeading - result.partialTrailingContent->partialRun->logicalWidth; 732 742 return { }; 733 743 };
Note:
See TracChangeset
for help on using the changeset viewer.