Changeset 250482 in webkit


Ignore:
Timestamp:
Sep 28, 2019 7:30:40 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Line::Box should have a const public interface
https://bugs.webkit.org/show_bug.cgi?id=202336
<rdar://problem/55798628>

Reviewed by Antti Koivisto.

Clean up Line::Box interface.

  • layout/inlineformatting/InlineLine.cpp:

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

  • layout/inlineformatting/InlineLine.h:

(WebCore::Layout::Line::Run::displayRun const):
(WebCore::Layout::Line::Run::isVisuallyEmpty const):
(WebCore::Layout::Line::Run::expand):
(WebCore::Layout::Line::Run::displayRun): Deleted.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r250464 r250482  
     12019-09-28  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Line::Box should have a const public interface
     4        https://bugs.webkit.org/show_bug.cgi?id=202336
     5        <rdar://problem/55798628>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Clean up Line::Box interface.
     10
     11        * layout/inlineformatting/InlineLine.cpp:
     12        (WebCore::Layout::Line::close):
     13        * layout/inlineformatting/InlineLine.h:
     14        (WebCore::Layout::Line::Run::displayRun const):
     15        (WebCore::Layout::Line::Run::isVisuallyEmpty const):
     16        (WebCore::Layout::Line::Run::expand):
     17        (WebCore::Layout::Line::Run::displayRun): Deleted.
     18
    1192019-09-27  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp

    r250439 r250482  
    179179        ASSERT(previousRun->isText());
    180180        ASSERT(currentRun->isText());
    181         auto& previousDisplayRun = previousRun->displayRun();
    182         auto& currentDisplayRun = currentRun->displayRun();
    183         previousDisplayRun.expandHorizontally(currentDisplayRun.logicalWidth());
    184         previousDisplayRun.textContext()->expand(currentDisplayRun.textContext()->length());
     181        previousRun->expand(*currentRun);
    185182        m_runList.remove(index);
    186183    }
  • trunk/Source/WebCore/layout/inlineformatting/InlineLine.h

    r250439 r250482  
    7070
    7171        const Display::Run& displayRun() const { return m_displayRun; }
    72         Display::Run& displayRun() { return m_displayRun; }
    7372        const Box& layoutBox() const { return m_inlineItem.layoutBox(); }
    7473
    7574        const Display::Rect& logicalRect() const { return m_displayRun.logicalRect(); }
     75        bool isVisuallyEmpty() const { return m_isVisuallyEmpty; }
    7676
    7777        bool isText() const { return m_inlineItem.isText(); }
     
    8181        bool isContainerEnd() const { return m_inlineItem.isContainerEnd(); }
    8282
    83         bool isVisuallyEmpty() const { return m_isVisuallyEmpty; }
    84         bool isWhitespace() const;
    85         bool canBeExtended() const;
    86 
    8783    private:
    8884        friend class Line;
     
    9086        void moveVertically(LayoutUnit offset) { m_displayRun.moveVertically(offset); }
    9187        void moveHorizontally(LayoutUnit offset) { m_displayRun.moveHorizontally(offset); }
     88
     89        void expand(const Run&);
     90
    9291        void setVisuallyIsEmpty() { m_isVisuallyEmpty = true; }
     92
     93        bool isWhitespace() const;
     94        bool canBeExtended() const;
    9395
    9496        const InlineItem& m_inlineItem;
     
    142144};
    143145
     146inline void Line::Run::expand(const Run& other)
     147{
     148    ASSERT(isText());
     149    ASSERT(other.isText());
     150
     151    auto& otherDisplayRun = other.displayRun();
     152    m_displayRun.expandHorizontally(otherDisplayRun.logicalWidth());
     153    m_displayRun.textContext()->expand(otherDisplayRun.textContext()->length());
     154}
     155
    144156}
    145157}
Note: See TracChangeset for help on using the changeset viewer.