Changeset 246678 in webkit


Ignore:
Timestamp:
Jun 21, 2019 8:31:02 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] LineBox::Baseline should have a height getter.
https://bugs.webkit.org/show_bug.cgi?id=199092
<rdar://problem/51966958>

Reviewed by Antti Koivisto.

The baseline height does not need to be a getter on the Line (no one calls it).

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::adjustBaselineAndLineHeight):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::contentLogicalWidth const):
(WebCore::Layout::Line::baselineAlignedContentHeight const): Deleted.

  • layout/inlineformatting/InlineLineBox.h:

(WebCore::Layout::LineBox::Baseline::height const):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246677 r246678  
     12019-06-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] LineBox::Baseline should have a height getter.
     4        https://bugs.webkit.org/show_bug.cgi?id=199092
     5        <rdar://problem/51966958>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        The baseline height does not need to be a getter on the Line (no one calls it).
     10
     11        * layout/inlineformatting/InlineLine.cpp:
     12        (WebCore::Layout::Line::adjustBaselineAndLineHeight):
     13        * layout/inlineformatting/InlineLine.h:
     14        (WebCore::Layout::Line::contentLogicalWidth const):
     15        (WebCore::Layout::Line::baselineAlignedContentHeight const): Deleted.
     16        * layout/inlineformatting/InlineLineBox.h:
     17        (WebCore::Layout::LineBox::Baseline::height const):
     18
    1192019-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
    220
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp

    r246634 r246678  
    320320        if (halfLeading.ascent > 0)
    321321            m_baseline.ascent = std::max(m_baseline.ascent, halfLeading.ascent);
    322         m_contentLogicalHeight = std::max(m_contentLogicalHeight, baselineAlignedContentHeight());
     322        m_contentLogicalHeight = std::max(m_contentLogicalHeight, m_baseline.height());
    323323        return;
    324324    }
     
    329329        m_baseline.ascent = std::max(m_initialStrut->ascent, m_baseline.ascent);
    330330        m_baseline.descent = std::max(m_initialStrut->descent, m_baseline.descent);
    331         m_contentLogicalHeight = std::max(m_contentLogicalHeight, baselineAlignedContentHeight());
     331        m_contentLogicalHeight = std::max(m_contentLogicalHeight, m_baseline.height());
    332332        m_initialStrut = { };
    333333        return;
     
    344344            m_baseline.descent = std::max(inlineBlockBaseline.descent, m_baseline.descent);
    345345            m_baseline.ascent = std::max(inlineBlockBaseline.ascent, m_baseline.ascent);
    346             m_contentLogicalHeight = std::max(std::max(m_contentLogicalHeight, runHeight), baselineAlignedContentHeight());
     346            m_contentLogicalHeight = std::max(std::max(m_contentLogicalHeight, runHeight), m_baseline.height());
    347347            break;
    348348        }
    349349        m_baseline.descent = std::max<LayoutUnit>(0, m_baseline.descent);
    350350        m_baseline.ascent = std::max(runHeight, m_baseline.ascent);
    351         m_contentLogicalHeight = std::max(m_contentLogicalHeight, baselineAlignedContentHeight());
     351        m_contentLogicalHeight = std::max(m_contentLogicalHeight, m_baseline.height());
    352352        break;
    353353    case VerticalAlign::Top:
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.h

    r246634 r246678  
    119119
    120120    LayoutUnit contentLogicalWidth() const { return m_contentLogicalWidth; }
    121     LayoutUnit baselineAlignedContentHeight() const { return m_baseline.ascent + m_baseline.descent; }
    122121    LayoutUnit baselineOffset() const { return m_baseline.ascent + m_baselineTop; }
    123122
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h

    r246484 r246678  
    3636public:
    3737    struct Baseline {
     38        LayoutUnit height() const { return ascent + descent; }
     39
    3840        LayoutUnit ascent;
    3941        LayoutUnit descent;
Note: See TracChangeset for help on using the changeset viewer.