Changeset 268815 in webkit
- Timestamp:
- Oct 21, 2020, 12:19:36 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
layout/inlineformatting/InlineFormattingContextGeometry.cpp (modified) (1 diff)
-
layout/inlineformatting/InlineLineBox.cpp (modified) (1 diff)
-
layout/inlineformatting/InlineLineBox.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r268814 r268815 1 2020-10-21 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][Integration] Ascent and descent are rounded to integral position 4 https://bugs.webkit.org/show_bug.cgi?id=218036 5 6 Reviewed by Antti Koivisto. 7 8 In this patch, we round ascent/descent vertical position values to integral to match legacy behavior. 9 10 * layout/inlineformatting/InlineFormattingContextGeometry.cpp: 11 (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 12 * layout/inlineformatting/InlineLineBox.cpp: 13 (WebCore::Layout::LineBox::InlineLevelBox::setBaseline): 14 (WebCore::Layout::LineBox::InlineLevelBox::setDescent): 15 (WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds): 16 * layout/inlineformatting/InlineLineBox.h: 17 (WebCore::Layout::LineBox::InlineLevelBox::setBaseline): Deleted. 18 (WebCore::Layout::LineBox::InlineLevelBox::setDescent): Deleted. 19 (WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds): Deleted. 20 1 21 2020-10-21 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp
r268658 r268815 261 261 auto& inlineLevelBoxGeometry = formattingContext().geometryForBox(layoutBox); 262 262 auto logicalHeight = inlineLevelBoxGeometry.marginBoxHeight(); 263 auto baseline= logicalHeight;263 auto ascent = logicalHeight; 264 264 if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) { 265 265 auto& formattingState = layoutState().establishedInlineFormattingState(downcast<ContainerBox>(layoutBox)); 266 266 auto& lastLine = formattingState.lines().last(); 267 267 auto inlineBlockBaseline = lastLine.logicalTop() + lastLine.baseline(); 268 baseline= inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderTop() + inlineLevelBoxGeometry.paddingTop().valueOr(0) + inlineBlockBaseline;268 ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderTop() + inlineLevelBoxGeometry.paddingTop().valueOr(0) + inlineBlockBaseline; 269 269 } 270 270 auto atomicInlineLevelBox = LineBox::InlineLevelBox::createAtomicInlineLevelBox(layoutBox, logicalLeft, { run.logicalWidth(), logicalHeight }); 271 atomicInlineLevelBox->setBaseline( baseline);272 atomicInlineLevelBox->setLayoutBounds(LineBox::InlineLevelBox::LayoutBounds { baseline, { } });271 atomicInlineLevelBox->setBaseline(ascent); 272 atomicInlineLevelBox->setLayoutBounds(LineBox::InlineLevelBox::LayoutBounds { ascent, { } }); 273 273 if (logicalHeight) 274 274 atomicInlineLevelBox->setIsNonEmpty(); -
trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp
r268654 r268815 38 38 , m_type(type) 39 39 { 40 } 41 42 void LineBox::InlineLevelBox::setBaseline(InlineLayoutUnit baseline) 43 { 44 // FIXME: Remove legacy rounding. 45 m_baseline = roundToInt(baseline); 46 } 47 48 void LineBox::InlineLevelBox::setDescent(InlineLayoutUnit descent) 49 { 50 // FIXME: Remove legacy rounding. 51 m_descent = roundToInt(descent); 52 } 53 54 void LineBox::InlineLevelBox::setLayoutBounds(const LayoutBounds& layoutBounds) 55 { 56 // FIXME: Remove legacy rounding. 57 m_layoutBounds = { InlineLayoutUnit(roundToInt(layoutBounds.ascent)), InlineLayoutUnit(roundToInt(layoutBounds.descent)) }; 40 58 } 41 59 -
trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h
r268642 r268815 103 103 void setLogicalWidth(InlineLayoutUnit logicalWidth) { m_logicalRect.setWidth(logicalWidth); } 104 104 void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(logicalHeight); } 105 void setBaseline(InlineLayoutUnit baseline) { m_baseline = baseline; }106 void setDescent(InlineLayoutUnit descent) { m_descent = descent; }105 void setBaseline(InlineLayoutUnit); 106 void setDescent(InlineLayoutUnit); 107 107 108 108 // See https://www.w3.org/TR/css-inline-3/#layout-bounds … … 113 113 InlineLayoutUnit descent { 0 }; 114 114 }; 115 void setLayoutBounds(const LayoutBounds& layoutBounds) { m_layoutBounds = layoutBounds; }115 void setLayoutBounds(const LayoutBounds&); 116 116 LayoutBounds layoutBounds() const { return m_layoutBounds; } 117 117
Note:
See TracChangeset
for help on using the changeset viewer.