Changeset 289897 in webkit
- Timestamp:
- Feb 16, 2022, 9:29:44 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r289896 r289897 1 2022-02-16 Alan Bujtas <zalan@apple.com> 2 3 [LFC][Integration] LineLayout::firstLineBaseline callers expect physical position 4 https://bugs.webkit.org/show_bug.cgi?id=236688 5 6 Reviewed by Antti Koivisto. 7 8 Legacy line layout returns the physical position too, though in a bit obscure manner: 9 10 firstRootBox()->logicalTop() + firstLineStyle().metricsOfPrimaryFont().descent(firstRootBox()->baselineType()) 11 where 12 // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line. 13 float logicalTop() const { return isHorizontal() ? m_topLeft.y() : m_topLeft.x(); } 14 15 * layout/integration/LayoutIntegrationLine.h: 16 (WebCore::LayoutIntegration::Line::lineBoxHeight const): 17 (WebCore::LayoutIntegration::Line::lineBoxWidth const): 18 * layout/integration/LayoutIntegrationLineLayout.cpp: 19 (WebCore::LayoutIntegration::LineLayout::firstLinePhysicalBaseline const): 20 (WebCore::LayoutIntegration::LineLayout::lastLineLogicalBaseline const): 21 (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const): Deleted. 22 (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const): Deleted. 23 * layout/integration/LayoutIntegrationLineLayout.h: 24 * rendering/RenderBlockFlow.cpp: 25 (WebCore::RenderBlockFlow::firstLineBaseline const): 26 (WebCore::RenderBlockFlow::inlineBlockBaseline const): 27 1 28 2022-02-16 Gavin Phillips <gavin.p@apple.com> 2 29 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLine.h
r289471 r289897 59 59 float lineBoxLeft() const { return m_lineBoxRect.x(); } 60 60 float lineBoxRight() const { return m_lineBoxRect.maxX(); } 61 float lineBoxHeight() const { return m_lineBoxRect.height(); } 62 float lineBoxWidth() const { return m_lineBoxRect.width(); } 61 63 62 64 float enclosingContentTop() const { return m_enclosingContentTop; } -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp
r289734 r289897 425 425 } 426 426 427 LayoutUnit LineLayout::firstLine Baseline() const427 LayoutUnit LineLayout::firstLinePhysicalBaseline() const 428 428 { 429 429 if (!m_inlineContent || m_inlineContent->lines.isEmpty()) { … … 436 436 return LayoutUnit { firstLine.lineBoxTop() + firstLine.baseline() }; 437 437 438 // See LineLayout::lastLineBaseline below for more info. 439 auto lineLogicalTop = flow().logicalHeight() - firstLine.lineBoxRight(); 440 return LayoutUnit { lineLogicalTop + firstLine.baseline() }; 441 } 442 443 LayoutUnit LineLayout::lastLineBaseline() const 438 return LayoutUnit { firstLine.lineBoxLeft() + (firstLine.lineBoxWidth() - firstLine.baseline()) }; 439 } 440 441 LayoutUnit LineLayout::lastLineLogicalBaseline() const 444 442 { 445 443 if (!m_inlineContent || m_inlineContent->lines.isEmpty()) { -
trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h
r288418 r289897 89 89 size_t lineCount() const; 90 90 91 LayoutUnit firstLine Baseline() const;92 LayoutUnit lastLine Baseline() const;91 LayoutUnit firstLinePhysicalBaseline() const; 92 LayoutUnit lastLineLogicalBaseline() const; 93 93 94 94 void adjustForPagination(); -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r289466 r289897 2960 2960 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 2961 2961 if (modernLineLayout()) 2962 return LayoutUnit { floorToInt(modernLineLayout()->firstLine Baseline()) };2962 return LayoutUnit { floorToInt(modernLineLayout()->firstLinePhysicalBaseline()) }; 2963 2963 #endif 2964 2964 … … 3011 3011 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 3012 3012 else if (modernLineLayout()) 3013 lastBaseline = floorToInt(modernLineLayout()->lastLine Baseline());3013 lastBaseline = floorToInt(modernLineLayout()->lastLineLogicalBaseline()); 3014 3014 #endif 3015 3015 }
Note:
See TracChangeset
for help on using the changeset viewer.