⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246478 in webkit


Ignore:
Timestamp:
Jun 16, 2019, 12:32:52 PM (7 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Remove Line::Content::isVisuallyEmpty
https://bugs.webkit.org/show_bug.cgi?id=198892
<rdar://problem/51780345>

Reviewed by Antti Koivisto.

Instead of setting the isVisuallyEmpty flag, reset the line height to 0.

  • layout/inlineformatting/InlineFormattingContextLineLayout.cpp:

(WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):

  • layout/inlineformatting/InlineLine.cpp:

(WebCore::Layout::Line::close):

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Content::isEmpty const):
(WebCore::Layout::Line::Content::setBaseline):
(WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
(WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246477 r246478  
     12019-06-16  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Remove Line::Content::isVisuallyEmpty
     4        https://bugs.webkit.org/show_bug.cgi?id=198892
     5        <rdar://problem/51780345>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Instead of setting the isVisuallyEmpty flag, reset the line height to 0.
     10
     11        * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
     12        (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const):
     13        * layout/inlineformatting/InlineLine.cpp:
     14        (WebCore::Layout::Line::close):
     15        * layout/inlineformatting/InlineLine.h:
     16        (WebCore::Layout::Line::Content::isEmpty const):
     17        (WebCore::Layout::Line::Content::setBaseline):
     18        (WebCore::Layout::Line::Content::isVisuallyEmpty const): Deleted.
     19        (WebCore::Layout::Line::Content::setIsVisuallyEmpty): Deleted.
     20
    1212019-06-16  Zalan Bujtas  <zalan@apple.com>
    222
  • trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp

    r246234 r246478  
    312312
    313313    // Ignore the initial strut.
    314     auto lineBox = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0, !lineContent.isVisuallyEmpty() ? lineContent.logicalHeight() : LayoutUnit { } };
     314    auto lineBox = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0, lineContent.logicalHeight()};
    315315    // Create final display runs.
    316316    auto& lineRuns = lineContent.runs();
     
    394394    // FIXME linebox needs to be ajusted after content alignment.
    395395    m_formattingState.addLineBox({ lineBox, lineContent.baseline() });
    396     if (!lineContent.isVisuallyEmpty())
    397         alignRuns(m_formattingRoot.style().textAlign(), previousLineLastRunIndex.valueOr(-1) + 1, widthConstraint - lineContent.logicalWidth());
     396    alignRuns(m_formattingRoot.style().textAlign(), previousLineLastRunIndex.valueOr(-1) + 1, widthConstraint - lineContent.logicalWidth());
    398397}
    399398
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp

    r246476 r246478  
    8787    removeTrailingTrimmableContent();
    8888    if (!m_skipVerticalAligment) {
     89        if (isVisuallyEmpty()) {
     90            m_baseline = { };
     91            m_contentLogicalHeight = { };
     92        }
     93
    8994        for (auto& run : m_content->runs()) {
    9095            LayoutUnit logicalTop;
     
    122127        }
    123128    }
    124     m_content->setIsVisuallyEmpty(isVisuallyEmpty());
    125129    m_content->setLogicalRect({ logicalTop(), logicalLeft(), contentLogicalWidth(), logicalHeight() });
    126130    m_content->setBaseline(m_baseline);
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.h

    r246475 r246478  
    6161        const Runs& runs() const { return m_runs; }
    6262        bool isEmpty() const { return m_runs.isEmpty(); }
    63         // Not in painting sense though.
    64         bool isVisuallyEmpty() const { return m_isVisuallyEmpty; }
    6563
    6664        LayoutUnit logicalTop() const { return m_logicalRect.top(); }
     
    7775        void setLogicalRect(const Display::Rect& logicalRect) { m_logicalRect = logicalRect; }
    7876        void setBaseline(LineBox::Baseline baseline) { m_baseline = baseline; }
    79         void setIsVisuallyEmpty(bool isVisuallyEmpty) { m_isVisuallyEmpty = isVisuallyEmpty; }
    8077        Runs& runs() { return m_runs; }
    8178
     
    8380        LineBox::Baseline m_baseline;
    8481        Runs m_runs;
    85         bool m_isVisuallyEmpty { true };
    8682    };
    8783    std::unique_ptr<Content> close();
Note: See TracChangeset for help on using the changeset viewer.