Changeset 285931 in webkit
- Timestamp:
- Nov 17, 2021, 8:30:20 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
layout/formattingContexts/inline/InlineLine.cpp (modified) (1 diff)
-
layout/formattingContexts/inline/InlineLine.h (modified) (1 diff)
-
layout/formattingContexts/inline/InlineLineBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285930 r285931 1 2021-11-17 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Fix imported/w3c/web-platform-tests/css/css-text/white-space/white-space-intrinsic-size-013.html 4 https://bugs.webkit.org/show_bug.cgi?id=233237 5 6 Reviewed by Antti Koivisto. 7 8 Do not take hanging glyphs into account when measuring content for preferred width. 9 (Note that this patch is in preparation for enabling IFC preferred width computation) 10 11 * layout/formattingContexts/inline/InlineLine.cpp: 12 (WebCore::Layout::Line::removeHangingGlyphs): 13 * layout/formattingContexts/inline/InlineLine.h: 14 * layout/formattingContexts/inline/InlineLineBuilder.cpp: 15 (WebCore::Layout::LineBuilder::close): 16 1 17 2021-11-17 Alan Bujtas <zalan@apple.com> 2 18 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
r285926 r285931 195 195 196 196 m_contentLogicalWidth -= m_trimmableTrailingContent.remove(); 197 } 198 199 void Line::removeHangingGlyphs() 200 { 201 ASSERT(m_trimmableTrailingContent.isEmpty()); 202 m_contentLogicalWidth -= m_hangingTrailingContent.width(); 203 m_hangingTrailingContent.reset(); 197 204 } 198 205 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.h
r285926 r285931 65 65 66 66 void removeTrailingTrimmableContent(); 67 void removeHangingGlyphs(); 67 68 void visuallyCollapseHangingOverflowingGlyphs(InlineLayoutUnit horizontalAvailableSpace); 68 69 void applyRunExpansion(InlineLayoutUnit horizontalAvailableSpace); -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
r285930 r285931 459 459 auto horizontalAvailableSpace = m_lineLogicalRect.width(); 460 460 m_line.removeTrailingTrimmableContent(); 461 m_line.visuallyCollapseHangingOverflowingGlyphs(horizontalAvailableSpace); 461 if (isInIntrinsicWidthMode()) { 462 // 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. 463 // https://drafts.csswg.org/css-text/#hanging 464 // FIXME: Add support for conditionally hanging glyphs. 465 m_line.removeHangingGlyphs(); 466 } else 467 m_line.visuallyCollapseHangingOverflowingGlyphs(horizontalAvailableSpace); 468 462 469 auto horizontalAlignment = root().style().textAlign(); 463 470 auto runsExpandHorizontally = horizontalAlignment == TextAlignMode::Justify && !isLastLineWithInlineContent(lineRange, needsLayoutRange.end, committedContent.partialTrailingContentLength);
Note:
See TracChangeset
for help on using the changeset viewer.