Changeset 208731 in webkit


Ignore:
Timestamp:
Nov 15, 2016 8:02:44 AM (7 years ago)
Author:
Alan Bujtas
Message:

[MultiCol] Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162833

Reviewed by Simon Fraser.

Source/WebCore:

This is a temporary workaround until after we addressed render tree mutation during layout (webkit.org/b/163849).

Test: fast/inline/out-of-flow-quotation-text-with-multicolumn.html

  • page/FrameView.cpp:

(WebCore::FrameView::layout):

  • rendering/RenderMultiColumnFlowThread.cpp:

(WebCore::RenderMultiColumnFlowThread::populate):
(WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):

  • rendering/RenderQuote.cpp:

(WebCore::RenderQuote::attachQuote): Populating/evacuating the flow should not trigger quotation text changes.
(WebCore::RenderQuote::detachQuote):

  • rendering/RenderView.h:

(WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope):
(WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope):

LayoutTests:

This patch actually fixes the renderering of the closing quotation mark. Currently, it is
not rendered at all.

  • fast/inline/out-of-flow-quotation-text-with-multicolumn-expected.html: Added.
  • fast/inline/out-of-flow-quotation-text-with-multicolumn.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208729 r208731  
     12016-11-15  Zalan Bujtas  <zalan@apple.com>
     2
     3        [MultiCol] Render tree should be all clean by the end of FrameView::layout().
     4        https://bugs.webkit.org/show_bug.cgi?id=162833
     5
     6        Reviewed by Simon Fraser.
     7
     8        This patch actually fixes the renderering of the closing quotation mark. Currently, it is
     9        not rendered at all.
     10
     11        * fast/inline/out-of-flow-quotation-text-with-multicolumn-expected.html: Added.
     12        * fast/inline/out-of-flow-quotation-text-with-multicolumn.html: Added.
     13
    1142016-11-15  Alejandro G. Castro  <alex@igalia.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r208730 r208731  
     12016-11-15  Zalan Bujtas  <zalan@apple.com>
     2
     3        [MultiCol] Render tree should be all clean by the end of FrameView::layout().
     4        https://bugs.webkit.org/show_bug.cgi?id=162833
     5
     6        Reviewed by Simon Fraser.
     7
     8        This is a temporary workaround until after we addressed render tree mutation during layout (webkit.org/b/163849).
     9
     10        Test: fast/inline/out-of-flow-quotation-text-with-multicolumn.html
     11
     12        * page/FrameView.cpp:
     13        (WebCore::FrameView::layout):
     14        * rendering/RenderMultiColumnFlowThread.cpp:
     15        (WebCore::RenderMultiColumnFlowThread::populate):
     16        (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
     17        * rendering/RenderQuote.cpp:
     18        (WebCore::RenderQuote::attachQuote): Populating/evacuating the flow should not trigger quotation text changes.
     19        (WebCore::RenderQuote::detachQuote):
     20        * rendering/RenderView.h:
     21        (WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope):
     22        (WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope):
     23
    1242016-11-15  Eric Carlson  <eric.carlson@apple.com>
    225
  • trunk/Source/WebCore/page/FrameView.cpp

    r208503 r208731  
    14711471#endif
    14721472        root->layout();
     1473        ASSERT(!root->view().renderTreeIsBeingMutatedInternally());
    14731474
    14741475#if ENABLE(TEXT_AUTOSIZING)
  • trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp

    r208597 r208731  
    152152    // sets and spanners) will be inserted there as we insert elements into the flow thread.
    153153    LayoutStateDisabler layoutStateDisabler(view());
     154    RenderTreeInternalMutationScope reparentingIsOn(view());
    154155    multicolContainer->moveChildrenTo(this, multicolContainer->firstChild(), this, true);
    155156}
     
    169170    // the flow thread that we're trying to empty.
    170171    multicolContainer->setMultiColumnFlowThread(nullptr);
     172    RenderTreeInternalMutationScope reparentingIsOn(view());
    171173    moveAllChildrenTo(multicolContainer, true);
    172174
  • trunk/Source/WebCore/rendering/RenderQuote.cpp

    r206821 r208731  
    390390void RenderQuote::attachQuote()
    391391{
     392    if (view().renderTreeIsBeingMutatedInternally())
     393        return;
     394
    392395    ASSERT(!m_isAttached);
    393396    ASSERT(!m_next);
     
    431434void RenderQuote::detachQuote()
    432435{
     436    if (view().renderTreeIsBeingMutatedInternally())
     437        return;
     438
    433439    ASSERT(!m_next || m_next->m_isAttached);
    434440    ASSERT(!m_previous || m_previous->m_isAttached);
  • trunk/Source/WebCore/rendering/RenderView.h

    r208668 r208731  
    202202    void setRenderQuoteHead(RenderQuote* head) { m_renderQuoteHead = head; }
    203203    RenderQuote* renderQuoteHead() const { return m_renderQuoteHead; }
     204   
     205    // FIXME: see class RenderTreeInternalMutation below.
     206    bool renderTreeIsBeingMutatedInternally() const { return !!m_renderTreeInternalMutationCounter; }
    204207
    205208    // FIXME: This is a work around because the current implementation of counters
     
    287290    }
    288291
     292    enum class RenderTreeInternalMutation { On, Off };
     293    void setRenderTreeInternalMutation(RenderTreeInternalMutation state)
     294    {
     295        if (state == RenderTreeInternalMutation::On)
     296            ++m_renderTreeInternalMutationCounter;
     297        else {
     298            ASSERT(m_renderTreeInternalMutationCounter);
     299            --m_renderTreeInternalMutationCounter;
     300        }
     301    }
     302
    289303    // Suspends the LayoutState optimization. Used under transforms that cannot be represented by
    290304    // LayoutState (common in SVG) and when manipulating the render tree during layout in ways
     
    308322    friend class LayoutStateDisabler;
    309323    friend class SubtreeLayoutStateMaintainer;
     324    friend class RenderTreeInternalMutationScope;
    310325
    311326    bool isScrollableOrRubberbandableBox() const override;
     
    359374    RenderQuote* m_renderQuoteHead { nullptr };
    360375    unsigned m_renderCounterCount { 0 };
     376    unsigned m_renderTreeInternalMutationCounter { 0 };
    361377
    362378    bool m_selectionWasCaret { false };
     
    456472};
    457473
     474// FIXME: This is a temporary workaround to mute unintended activities triggered by render tree mutations.
     475class RenderTreeInternalMutationScope {
     476    WTF_MAKE_NONCOPYABLE(RenderTreeInternalMutationScope);
     477public:
     478    RenderTreeInternalMutationScope(RenderView& view)
     479        : m_view(view)
     480    {
     481        m_view.setRenderTreeInternalMutation(RenderView::RenderTreeInternalMutation::On);
     482    }
     483
     484    ~RenderTreeInternalMutationScope()
     485    {
     486        m_view.setRenderTreeInternalMutation(RenderView::RenderTreeInternalMutation::Off);
     487    }
     488
     489private:
     490    RenderView& m_view;
     491};
     492
    458493} // namespace WebCore
    459494
Note: See TracChangeset for help on using the changeset viewer.