Changeset 269818 in webkit
- Timestamp:
- Nov 14, 2020 9:38:37 AM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269817 r269818 1 2020-11-14 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][Integration] Use the physical size when setting the pre-computed width/height on ReplacedBox 4 https://bugs.webkit.org/show_bug.cgi?id=218915 5 6 Reviewed by Antti Koivisto. 7 8 This is where the logical vs. physical coordinate flip happens on the integration level. 9 10 * layout/integration/LayoutIntegrationLineLayout.cpp: 11 (WebCore::LayoutIntegration::LineLayout::updateReplacedDimensions): 12 (WebCore::LayoutIntegration::LineLayout::updateInlineBlockDimensions): 13 * layout/integration/LayoutIntegrationLineLayout.h: 14 * rendering/RenderBlockFlow.cpp: 15 (WebCore::RenderBlockFlow::layoutModernLines): 16 1 17 2020-11-14 Zalan Bujtas <zalan@apple.com> 2 18 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r269817 r269818 111 111 void LineLayout::updateReplacedDimensions(const RenderBox& replaced) 112 112 { 113 auto& layoutBox = m_boxTree.layoutBoxForRenderer(replaced); 113 updateLayoutBoxDimensions(replaced); 114 } 115 116 void LineLayout::updateInlineBlockDimensions(const RenderBlock& inlineBlock) 117 { 118 updateLayoutBoxDimensions(inlineBlock); 119 } 120 121 void LineLayout::updateLayoutBoxDimensions(const RenderBox& replacedOrInlineBlock) 122 { 123 auto& layoutBox = m_boxTree.layoutBoxForRenderer(replacedOrInlineBlock); 124 // Internally both replaced and inline-box content use replaced boxes. 114 125 auto& replacedBox = downcast<Layout::ReplacedBox>(layoutBox); 115 126 116 replacedBox.setContentSizeForIntegration({ replaced.contentLogicalWidth(), replaced.contentLogicalHeight() }); 117 118 auto baseline = replaced.baselinePosition(AlphabeticBaseline, false /* firstLine */, HorizontalLine, PositionOnContainingLine); 127 // Always use the physical size here for inline level boxes (this is where the logical vs. physical coords flip happens). 128 replacedBox.setContentSizeForIntegration({ replacedOrInlineBlock.contentWidth(), replacedOrInlineBlock.contentHeight() }); 129 130 auto baseline = replacedOrInlineBlock.baselinePosition(AlphabeticBaseline, false /* firstLine */, HorizontalLine, PositionOnContainingLine); 119 131 replacedBox.setBaseline(baseline); 120 132 } -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h
r269726 r269818 65 65 66 66 void updateReplacedDimensions(const RenderBox&); 67 void updateInlineBlockDimensions(const RenderBlock&); 67 68 void updateStyle(const RenderBoxModelObject&); 68 69 void layout(); … … 102 103 void constructContent(); 103 104 InlineContent& ensureInlineContent(); 105 void updateLayoutBoxDimensions(const RenderBox&); 104 106 105 107 RenderBlockFlow& flow() { return m_boxTree.flow(); } -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r269693 r269818 3622 3622 auto& block = downcast<RenderBlock>(renderer); 3623 3623 block.layoutIfNeeded(); 3624 // FIXME: Taking the same path as replaced for now.3625 layoutFormattingContextLineLayout.update ReplacedDimensions(block);3624 ASSERT(block.style().display() == DisplayType::InlineBlock); 3625 layoutFormattingContextLineLayout.updateInlineBlockDimensions(block); 3626 3626 continue; 3627 3627 }
Note: See TracChangeset
for help on using the changeset viewer.