Changeset 269817 in webkit
- Timestamp:
- Nov 14, 2020 7:26:56 AM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269816 r269817 1 2020-11-14 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Display runs generated by boxes should have border box geometries 4 https://bugs.webkit.org/show_bug.cgi?id=218932 5 6 Reviewed by Antti Koivisto. 7 8 Layout::Runs/InlineBoxes have margin box geometries, but the Display::Runs should preserve border box instead. 9 This is mostly interesting in the context of negative vertical margins where such margin values could make the run "empty". 10 11 * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: 12 (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): 13 * layout/integration/LayoutIntegrationLineLayout.cpp: 14 (WebCore::LayoutIntegration::LineLayout::constructContent): 15 1 16 2020-11-14 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContentBuilder.cpp
r269773 r269817 211 211 212 212 auto createDisplayBoxRun = [&](auto& lineRun) { 213 auto& layoutBox = lineRun.layoutBox(); 213 214 auto lineIndex = lineRun.lineIndex(); 214 215 auto& line = lines[lineIndex]; … … 216 217 // FIXME: Shouldn't we just leave them be relative to the line box? 217 218 auto runRect = FloatRect { lineRun.logicalRect() }; 218 runRect.moveBy({ line.logicalLeft(), line.logicalTop() }); 219 // Line runs are margin box based, let's convert them to border box. 220 auto& geometry = m_layoutState.geometryForBox(layoutBox); 221 runRect.moveBy({ line.logicalLeft() + std::max(geometry.marginStart(), 0_lu), line.logicalTop() + geometry.marginBefore() }); 222 runRect.setSize({ geometry.borderBoxWidth(), geometry.borderBoxHeight() }); 219 223 if (lineLevelVisualAdjustmentsForRuns[lineIndex].needsIntegralPosition) 220 224 runRect.setY(roundToInt(runRect.y())); 221 225 // FIXME: Add support for non-text ink overflow. 222 226 // FIXME: Add support for cases when the run is after ellipsis. 223 inlineContent.runs.append({ lineIndex, l ineRun.layoutBox(), runRect, runRect, { }, { } });227 inlineContent.runs.append({ lineIndex, layoutBox, runRect, runRect, { }, { } }); 224 228 }; 225 229 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r269770 r269817 155 155 continue; 156 156 157 auto& runRect = run.rect();158 157 auto& renderer = downcast<RenderBox>(m_boxTree.rendererForLayoutBox(layoutBox)); 159 auto& boxGeometry = m_layoutState.geometryForBox(layoutBox); 160 auto borderBoxLocation = FloatPoint { runRect.x() + std::max(boxGeometry.marginStart(), 0_lu), runRect.y() + boxGeometry.marginBefore() }; 161 renderer.setLocation(flooredLayoutPoint(borderBoxLocation)); 158 renderer.setLocation(flooredLayoutPoint(run.rect().location())); 162 159 } 163 160
Note: See TracChangeset
for help on using the changeset viewer.