Title: [272118] trunk/Source/WebCore
- Revision
- 272118
- Author
- [email protected]
- Date
- 2021-01-30 11:34:48 -0800 (Sat, 30 Jan 2021)
Log Message
[LFC][IFC] Line gap metric should apply to all inline boxes
https://bugs.webkit.org/show_bug.cgi?id=221179
Reviewed by Antti Koivisto.
According to the CSS spec (https://www.w3.org/TR/css-inline-3/#inline-height)
when the line-height computes to normal (RenderStyle::lineHeight().isNegative()) and
either text-edge is leading (property is not supported yet, initial value is leading) or
this is the root inline box, the font’s line gap should be taken into account when computing
layout bounds.
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (272117 => 272118)
--- trunk/Source/WebCore/ChangeLog 2021-01-30 18:47:44 UTC (rev 272117)
+++ trunk/Source/WebCore/ChangeLog 2021-01-30 19:34:48 UTC (rev 272118)
@@ -1,3 +1,19 @@
+2021-01-30 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] Line gap metric should apply to all inline boxes
+ https://bugs.webkit.org/show_bug.cgi?id=221179
+
+ Reviewed by Antti Koivisto.
+
+ According to the CSS spec (https://www.w3.org/TR/css-inline-3/#inline-height)
+ when the line-height computes to normal (RenderStyle::lineHeight().isNegative()) and
+ either text-edge is leading (property is not supported yet, initial value is leading) or
+ this is the root inline box, the font’s line gap should be taken into account when computing
+ layout bounds.
+
+ * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+ (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const):
+
2021-01-30 Wenson Hsieh <[email protected]>
[macOS] Remove support for image controls
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp (272117 => 272118)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2021-01-30 18:47:44 UTC (rev 272117)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2021-01-30 19:34:48 UTC (rev 272118)
@@ -185,12 +185,12 @@
if (lineHeight.isNegative()) {
// If line-height computes to normal and either text-edge is leading or this is the root inline box,
// the font’s line gap metric may also be incorporated into A and D by adding half to each side as half-leading.
- auto shouldLineGapStretchInlineLevelBox = inlineLevelBox.isRootInlineBox() || inlineLevelBox.isLineBreakBox();
- if (shouldLineGapStretchInlineLevelBox) {
- auto halfLineGap = (fontMetrics.lineSpacing() - logicalHeight) / 2;
- ascent += halfLineGap;
- descent += halfLineGap;
- }
+ // https://www.w3.org/TR/css-inline-3/#inline-height
+ // Since text-edge is not supported yet and the initial value is leading, we should just apply it to
+ // all inline boxes.
+ auto halfLineGap = (fontMetrics.lineSpacing() - logicalHeight) / 2;
+ ascent += halfLineGap;
+ descent += halfLineGap;
} else {
InlineLayoutUnit lineHeight = style.computedLineHeight();
InlineLayoutUnit halfLeading = (lineHeight - (ascent + descent)) / 2;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes