Changeset 285999 in webkit
- Timestamp:
- Nov 18, 2021, 6:20:45 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
layout/formattingContexts/inline/InlineLineBuilder.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285998 r285999 1 2021-11-18 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Glyphs that conditionally hang are taken into account for max-content only 4 https://bugs.webkit.org/show_bug.cgi?id=233287 5 6 Reviewed by Antti Koivisto. 7 8 Remove hanging glyphs for min-content only. It simply means that content followed by (pre-wrap) whitespace may make shrink wrapped lines wider. 9 10 * layout/formattingContexts/inline/InlineLineBuilder.cpp: 11 (WebCore::Layout::LineBuilder::close): 12 * rendering/RenderBlockFlow.cpp: 13 1 14 2021-11-18 Ziran Sun <zsun@igalia.com> 2 15 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
r285956 r285999 460 460 return lineRange; 461 461 } 462 auto isLastLine = isLastLineWithInlineContent(lineRange, needsLayoutRange.end, committedContent.partialTrailingContentLength); 462 463 auto horizontalAvailableSpace = m_lineLogicalRect.width(); 463 464 auto isInIntrinsicWidthMode = this->isInIntrinsicWidthMode(); … … 473 474 // When a glyph at the start or end edge of a line hangs, it is not considered when measuring the line’s contents for fit. 474 475 // https://drafts.csswg.org/css-text/#hanging 475 // FIXME: Add support for conditionally hanging glyphs. 476 m_line.removeHangingGlyphs(); 476 if (*intrinsicWidthMode() == IntrinsicWidthMode::Minimum) 477 m_line.removeHangingGlyphs(); 478 else { 479 // Glyphs that conditionally hang are not taken into account when computing min-content sizes and any sizes derived thereof, but they are taken into account for max-content sizes and any sizes derived thereof. 480 auto isConditionalHanging = isLastLine || (!m_line.runs().isEmpty() && m_line.runs().last().isLineBreak()); 481 if (!isConditionalHanging) 482 m_line.removeHangingGlyphs(); 483 } 477 484 } else 478 485 m_line.visuallyCollapseHangingOverflowingGlyphs(horizontalAvailableSpace); 479 486 480 487 auto horizontalAlignment = root().style().textAlign(); 481 auto runsExpandHorizontally = horizontalAlignment == TextAlignMode::Justify && !isLastLine WithInlineContent(lineRange, needsLayoutRange.end, committedContent.partialTrailingContentLength);488 auto runsExpandHorizontally = horizontalAlignment == TextAlignMode::Justify && !isLastLine; 482 489 if (runsExpandHorizontally) 483 490 m_line.applyRunExpansion(horizontalAvailableSpace);
Note:
See TracChangeset
for help on using the changeset viewer.