Changeset 246477 in webkit


Ignore:
Timestamp:
Jun 16, 2019 12:30:46 PM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC] Add limited quirks mode to LayoutState.
https://bugs.webkit.org/show_bug.cgi?id=198881
<rdar://problem/51773229>

Reviewed by Antti Koivisto.

This is in preparation for introducing limited quirks mode to inline layout.

  • layout/LayoutState.h:

(WebCore::Layout::LayoutState::setQuirksMode):
(WebCore::Layout::LayoutState::inQuirksMode const):
(WebCore::Layout::LayoutState::inLimitedQuirksMode const):
(WebCore::Layout::LayoutState::inNoQuirksMode const):
(WebCore::Layout::LayoutState::setInQuirksMode): Deleted.

  • page/FrameViewLayoutContext.cpp:

(WebCore::layoutUsingFormattingContext):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246476 r246477  
     12019-06-16  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Add limited quirks mode to LayoutState.
     4        https://bugs.webkit.org/show_bug.cgi?id=198881
     5        <rdar://problem/51773229>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        This is in preparation for introducing limited quirks mode to inline layout.
     10
     11        * layout/LayoutState.h:
     12        (WebCore::Layout::LayoutState::setQuirksMode):
     13        (WebCore::Layout::LayoutState::inQuirksMode const):
     14        (WebCore::Layout::LayoutState::inLimitedQuirksMode const):
     15        (WebCore::Layout::LayoutState::inNoQuirksMode const):
     16        (WebCore::Layout::LayoutState::setInQuirksMode): Deleted.
     17        * page/FrameViewLayoutContext.cpp:
     18        (WebCore::layoutUsingFormattingContext):
     19
    1202019-06-16  Zalan Bujtas  <zalan@apple.com>
    221
  • trunk/Source/WebCore/layout/LayoutState.h

    r240895 r246477  
    6464    void updateLayout();
    6565    void styleChanged(const Box&, StyleDiff);
    66     void setInQuirksMode(bool inQuirksMode) { m_inQuirksMode = inQuirksMode; }
     66    enum class QuirksMode { No, Limited, Yes };
     67    void setQuirksMode(QuirksMode quirksMode) { m_quirksMode = quirksMode; }
    6768
    6869    enum class UpdateType {
     
    8990    bool hasDisplayBox(const Box& layoutBox) const { return m_layoutToDisplayBox.contains(&layoutBox); }
    9091
    91     bool inQuirksMode() const { return m_inQuirksMode; }
     92    bool inQuirksMode() const { return m_quirksMode == QuirksMode::Yes; }
     93    bool inLimitedQuirksMode() const { return m_quirksMode == QuirksMode::Limited; }
     94    bool inNoQuirksMode() const { return m_quirksMode == QuirksMode::No; }
    9295    // For testing purposes only
    9396    void verifyAndOutputMismatchingLayoutTree(const RenderView&) const;
     
    104107#endif
    105108    mutable HashMap<const Box*, std::unique_ptr<Display::Box>> m_layoutToDisplayBox;
    106     bool m_inQuirksMode { false };
     109    QuirksMode m_quirksMode { QuirksMode::No };
    107110};
    108111
  • trunk/Source/WebCore/page/FrameViewLayoutContext.cpp

    r245868 r246477  
    6161    auto initialContainingBlock = Layout::TreeBuilder::createLayoutTree(renderView);
    6262    auto layoutState = std::make_unique<Layout::LayoutState>(*initialContainingBlock);
    63     layoutState->setInQuirksMode(renderView.document().inQuirksMode());
     63    auto quirksMode = Layout::LayoutState::QuirksMode::No;
     64    if (renderView.document().inLimitedQuirksMode())
     65        quirksMode = Layout::LayoutState::QuirksMode::Limited;
     66    else if (renderView.document().inQuirksMode())
     67        quirksMode = Layout::LayoutState::QuirksMode::Yes;
     68    layoutState->setQuirksMode(quirksMode);
    6469    layoutState->updateLayout();
    6570    layoutState->verifyAndOutputMismatchingLayoutTree(renderView);
Note: See TracChangeset for help on using the changeset viewer.