Changeset 256458 in webkit


Ignore:
Timestamp:
Feb 12, 2020 11:07:24 AM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC][IFC] Display::Run should not have any geometry mutation functions.
https://bugs.webkit.org/show_bug.cgi?id=207633
<rdar://problem/59386235>

Reviewed by Antti Koivisto.

Now that Display::Runs are constructed after merging the runs on the line, we don't need any of
these mutation functions.

  • layout/displaytree/DisplayRun.h:

(WebCore::Display::Run::textContent const):
(WebCore::Display::Run::isLineBreak const):
(WebCore::Display::Run::lineIndex const):
(WebCore::Display::Run::setWidth): Deleted.
(WebCore::Display::Run::setTop): Deleted.
(WebCore::Display::Run::setlLeft): Deleted.
(WebCore::Display::Run::moveVertically): Deleted.
(WebCore::Display::Run::moveHorizontally): Deleted.
(WebCore::Display::Run::expandVertically): Deleted.
(WebCore::Display::Run::expandHorizontally): Deleted.
(WebCore::Display::Run::setTextContent): Deleted.
(WebCore::Display::Run::setExpansion): Deleted.
(WebCore::Display::Run::setImage): Deleted.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r256451 r256458  
     12020-02-12  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][IFC] Display::Run should not have any geometry mutation functions.
     4        https://bugs.webkit.org/show_bug.cgi?id=207633
     5        <rdar://problem/59386235>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Now that Display::Runs are constructed after merging the runs on the line, we don't need any of
     10        these mutation functions.
     11
     12        * layout/displaytree/DisplayRun.h:
     13        (WebCore::Display::Run::textContent const):
     14        (WebCore::Display::Run::isLineBreak const):
     15        (WebCore::Display::Run::lineIndex const):
     16        (WebCore::Display::Run::setWidth): Deleted.
     17        (WebCore::Display::Run::setTop): Deleted.
     18        (WebCore::Display::Run::setlLeft): Deleted.
     19        (WebCore::Display::Run::moveVertically): Deleted.
     20        (WebCore::Display::Run::moveHorizontally): Deleted.
     21        (WebCore::Display::Run::expandVertically): Deleted.
     22        (WebCore::Display::Run::expandHorizontally): Deleted.
     23        (WebCore::Display::Run::setTextContent): Deleted.
     24        (WebCore::Display::Run::setExpansion): Deleted.
     25        (WebCore::Display::Run::setImage): Deleted.
     26
    1272020-02-12  Megan Gardner  <megan_gardner@apple.com>
    228
  • trunk/Source/WebCore/layout/displaytree/DisplayRun.h

    r256437 r256458  
    6666    Run(size_t lineIndex, const Layout::Box&, const InlineRect&, const InlineRect& inkOverflow, Expansion, Optional<TextContent> = WTF::nullopt);
    6767
    68     size_t lineIndex() const { return m_lineIndex; }
    69 
    7068    const InlineRect& rect() const { return m_rect; }
    7169    const InlineRect& inkOverflow() const { return m_inkOverflow; }
     
    8078    InlineLayoutUnit height() const { return m_rect.height(); }
    8179
    82     void setWidth(InlineLayoutUnit width) { m_rect.setWidth(width); }
    83     void setTop(InlineLayoutUnit top) { m_rect.setTop(top); }
    84     void setlLeft(InlineLayoutUnit left) { m_rect.setLeft(left); }
    85     void moveVertically(InlineLayoutUnit delta) { m_rect.moveVertically(delta); }
    86     void moveHorizontally(InlineLayoutUnit delta) { m_rect.moveHorizontally(delta); }
    87     void expandVertically(InlineLayoutUnit delta) { m_rect.expandVertically(delta); }
    88     void expandHorizontally(InlineLayoutUnit delta) { m_rect.expandHorizontally(delta); }
    89 
    90     void setTextContent(const TextContent&& textContent) { m_textContent.emplace(textContent); }
     80    Optional<TextContent>& textContent() { return m_textContent; }
    9181    const Optional<TextContent>& textContent() const { return m_textContent; }
    92     Optional<TextContent>& textContent() { return m_textContent; }
     82    // FIXME: This information should be preserved at Run construction time.
     83    bool isLineBreak() const { return layoutBox().isLineBreakBox() || (textContent() && textContent()->content() == "\n" && style().preserveNewline()); }
    9384
    9485    struct Expansion {
     
    9687        InlineLayoutUnit horizontalExpansion { 0 };
    9788    };
    98     void setExpansion(Expansion expansion) { m_expansion = expansion; }
    9989    Expansion expansion() const { return m_expansion; }
    10090
    101     void setImage(CachedImage& image) { m_cachedImage = &image; }
    10291    CachedImage* image() const { return m_cachedImage; }
    103 
    104     // FIXME: This information should be preserved at Run construction time.
    105     bool isLineBreak() const { return layoutBox().isLineBreakBox() || (textContent() && textContent()->content() == "\n" && style().preserveNewline()); }
    10692
    10793    const Layout::Box& layoutBox() const { return *m_layoutBox; }
    10894    const RenderStyle& style() const { return m_layoutBox->style(); }
     95
     96    size_t lineIndex() const { return m_lineIndex; }
    10997
    11098private:
Note: See TracChangeset for help on using the changeset viewer.