Changeset 272118 in webkit
- Timestamp:
- Jan 30, 2021, 11:34:48 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
layout/inlineformatting/InlineFormattingContextGeometry.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r272117 r272118 1 2021-01-30 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Line gap metric should apply to all inline boxes 4 https://bugs.webkit.org/show_bug.cgi?id=221179 5 6 Reviewed by Antti Koivisto. 7 8 According to the CSS spec (https://www.w3.org/TR/css-inline-3/#inline-height) 9 when the line-height computes to normal (RenderStyle::lineHeight().isNegative()) and 10 either text-edge is leading (property is not supported yet, initial value is leading) or 11 this is the root inline box, the font’s line gap should be taken into account when computing 12 layout bounds. 13 14 * layout/inlineformatting/InlineFormattingContextGeometry.cpp: 15 (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const): 16 1 17 2021-01-30 Wenson Hsieh <wenson_hsieh@apple.com> 2 18 -
trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp
r272115 r272118 186 186 // If line-height computes to normal and either text-edge is leading or this is the root inline box, 187 187 // the font’s line gap metric may also be incorporated into A and D by adding half to each side as half-leading. 188 auto shouldLineGapStretchInlineLevelBox = inlineLevelBox.isRootInlineBox() || inlineLevelBox.isLineBreakBox();189 if (shouldLineGapStretchInlineLevelBox) {190 auto halfLineGap = (fontMetrics.lineSpacing() - logicalHeight) / 2;191 ascent += halfLineGap;192 descent += halfLineGap;193 }188 // https://www.w3.org/TR/css-inline-3/#inline-height 189 // Since text-edge is not supported yet and the initial value is leading, we should just apply it to 190 // all inline boxes. 191 auto halfLineGap = (fontMetrics.lineSpacing() - logicalHeight) / 2; 192 ascent += halfLineGap; 193 descent += halfLineGap; 194 194 } else { 195 195 InlineLayoutUnit lineHeight = style.computedLineHeight();
Note:
See TracChangeset
for help on using the changeset viewer.