<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208731] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208731">208731</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2016-11-15 08:02:44 -0800 (Tue, 15 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMultiColumnFlowThreadcpp">trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderQuotecpp">trunk/Source/WebCore/rendering/RenderQuote.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewh">trunk/Source/WebCore/rendering/RenderView.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastinlineoutofflowquotationtextwithmulticolumnexpectedhtml">trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastinlineoutofflowquotationtextwithmulticolumnhtml">trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208730 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-15 12:27:11 UTC (rev 208730)
+++ trunk/LayoutTests/ChangeLog        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-11-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        [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.
+
+        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.
+
</ins><span class="cx"> 2016-11-15  Alejandro G. Castro  &lt;alex@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebRTC: update MediaStream-MediaElement-srcObject.html test and unskip it
</span></span></pre></div>
<a id="trunkLayoutTestsfastinlineoutofflowquotationtextwithmulticolumnexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn-expected.html (0 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn-expected.html        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;title&gt;This tests that out-of-flow quotes with multicolumn show up.&lt;/title&gt;
+&lt;head&gt;
+&lt;style&gt;
+div { 
+  position: fixed;
+  left: 0px;
+  top: 0px;
+} 
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div&gt;&quot;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastinlineoutofflowquotationtextwithmulticolumnhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn.html (0 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn.html                                (rev 0)
+++ trunk/LayoutTests/fast/inline/out-of-flow-quotation-text-with-multicolumn.html        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;title&gt;This tests that out-of-flow quotes with multicolumn show up.&lt;/title&gt;
+&lt;head&gt;
+&lt;style&gt;
+q:before { 
+  position: fixed;
+  column-count: 2;
+  color: transparent;
+} 
+
+q:after { 
+  position: fixed;
+  left: 0px;
+  top: 0px;
+} 
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;q&gt;&amp;nbsp&lt;/q&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208730 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-15 12:27:11 UTC (rev 208730)
+++ trunk/Source/WebCore/ChangeLog        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-11-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        [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.
+
+        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):
+
</ins><span class="cx"> 2016-11-15  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (208730 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-11-15 12:27:11 UTC (rev 208730)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -1470,6 +1470,7 @@
</span><span class="cx">         RenderTreeNeedsLayoutChecker checker(*root);
</span><span class="cx"> #endif
</span><span class="cx">         root-&gt;layout();
</span><ins>+        ASSERT(!root-&gt;view().renderTreeIsBeingMutatedInternally());
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(TEXT_AUTOSIZING)
</span><span class="cx">         if (frame().settings().textAutosizingEnabled() &amp;&amp; !root-&gt;view().printing()) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMultiColumnFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp (208730 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp        2016-11-15 12:27:11 UTC (rev 208730)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -151,6 +151,7 @@
</span><span class="cx">     // now. At this point there's obviously nothing after the flow thread, but renderers (column
</span><span class="cx">     // sets and spanners) will be inserted there as we insert elements into the flow thread.
</span><span class="cx">     LayoutStateDisabler layoutStateDisabler(view());
</span><ins>+    RenderTreeInternalMutationScope reparentingIsOn(view());
</ins><span class="cx">     multicolContainer-&gt;moveChildrenTo(this, multicolContainer-&gt;firstChild(), this, true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -168,6 +169,7 @@
</span><span class="cx">     // container, we need to unregister the flow thread, so that they aren't just re-added again to
</span><span class="cx">     // the flow thread that we're trying to empty.
</span><span class="cx">     multicolContainer-&gt;setMultiColumnFlowThread(nullptr);
</span><ins>+    RenderTreeInternalMutationScope reparentingIsOn(view());
</ins><span class="cx">     moveAllChildrenTo(multicolContainer, true);
</span><span class="cx"> 
</span><span class="cx">     // Move spanners back to their original DOM position in the tree, and destroy the placeholders.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderQuotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderQuote.cpp (208730 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderQuote.cpp        2016-11-15 12:27:11 UTC (rev 208730)
+++ trunk/Source/WebCore/rendering/RenderQuote.cpp        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -389,6 +389,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderQuote::attachQuote()
</span><span class="cx"> {
</span><ins>+    if (view().renderTreeIsBeingMutatedInternally())
+        return;
+
</ins><span class="cx">     ASSERT(!m_isAttached);
</span><span class="cx">     ASSERT(!m_next);
</span><span class="cx">     ASSERT(!m_previous);
</span><span class="lines">@@ -430,6 +433,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderQuote::detachQuote()
</span><span class="cx"> {
</span><ins>+    if (view().renderTreeIsBeingMutatedInternally())
+        return;
+
</ins><span class="cx">     ASSERT(!m_next || m_next-&gt;m_isAttached);
</span><span class="cx">     ASSERT(!m_previous || m_previous-&gt;m_isAttached);
</span><span class="cx">     if (!m_isAttached)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.h (208730 => 208731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.h        2016-11-15 12:27:11 UTC (rev 208730)
+++ trunk/Source/WebCore/rendering/RenderView.h        2016-11-15 16:02:44 UTC (rev 208731)
</span><span class="lines">@@ -201,6 +201,9 @@
</span><span class="cx"> 
</span><span class="cx">     void setRenderQuoteHead(RenderQuote* head) { m_renderQuoteHead = head; }
</span><span class="cx">     RenderQuote* renderQuoteHead() const { return m_renderQuoteHead; }
</span><ins>+    
+    // FIXME: see class RenderTreeInternalMutation below.
+    bool renderTreeIsBeingMutatedInternally() const { return !!m_renderTreeInternalMutationCounter; }
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: This is a work around because the current implementation of counters
</span><span class="cx">     // requires walking the entire tree repeatedly and most pages don't actually use either
</span><span class="lines">@@ -286,6 +289,17 @@
</span><span class="cx">         m_layoutState = WTFMove(m_layoutState-&gt;m_next);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    enum class RenderTreeInternalMutation { On, Off };
+    void setRenderTreeInternalMutation(RenderTreeInternalMutation state)
+    {
+        if (state == RenderTreeInternalMutation::On)
+            ++m_renderTreeInternalMutationCounter;
+        else {
+            ASSERT(m_renderTreeInternalMutationCounter);
+            --m_renderTreeInternalMutationCounter;
+        }
+    }
+
</ins><span class="cx">     // Suspends the LayoutState optimization. Used under transforms that cannot be represented by
</span><span class="cx">     // LayoutState (common in SVG) and when manipulating the render tree during layout in ways
</span><span class="cx">     // that can trigger repaint of a non-child (e.g. when a list item moves its list marker around).
</span><span class="lines">@@ -307,6 +321,7 @@
</span><span class="cx">     friend class LayoutStateMaintainer;
</span><span class="cx">     friend class LayoutStateDisabler;
</span><span class="cx">     friend class SubtreeLayoutStateMaintainer;
</span><ins>+    friend class RenderTreeInternalMutationScope;
</ins><span class="cx"> 
</span><span class="cx">     bool isScrollableOrRubberbandableBox() const override;
</span><span class="cx"> 
</span><span class="lines">@@ -358,6 +373,7 @@
</span><span class="cx"> 
</span><span class="cx">     RenderQuote* m_renderQuoteHead { nullptr };
</span><span class="cx">     unsigned m_renderCounterCount { 0 };
</span><ins>+    unsigned m_renderTreeInternalMutationCounter { 0 };
</ins><span class="cx"> 
</span><span class="cx">     bool m_selectionWasCaret { false };
</span><span class="cx">     bool m_hasSoftwareFilters { false };
</span><span class="lines">@@ -455,6 +471,25 @@
</span><span class="cx">     RenderView&amp; m_view;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+// FIXME: This is a temporary workaround to mute unintended activities triggered by render tree mutations.
+class RenderTreeInternalMutationScope {
+    WTF_MAKE_NONCOPYABLE(RenderTreeInternalMutationScope);
+public:
+    RenderTreeInternalMutationScope(RenderView&amp; view)
+        : m_view(view)
+    {
+        m_view.setRenderTreeInternalMutation(RenderView::RenderTreeInternalMutation::On);
+    }
+
+    ~RenderTreeInternalMutationScope()
+    {
+        m_view.setRenderTreeInternalMutation(RenderView::RenderTreeInternalMutation::Off);
+    }
+
+private:
+    RenderView&amp; m_view;
+};
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderView, isRenderView())
</span></span></pre>
</div>
</div>

</body>
</html>