LayoutTests/ChangeLog

 12013-01-29 Mihai Maerean <mmaerean@adobe.com>
 2
 3 [CSSRegions] Assertion failure in Node::detach (!renderer || renderer->inRenderFlowThread())
 4 https://bugs.webkit.org/show_bug.cgi?id=104517
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 The RenderObject::inRenderFlowThread bit could have become disconnected from the fact that the RenderObject
 9 has (or not) an enclosing RenderFlowThread.
 10 The cause of this was that, when setting or removing the parent of a RenderObject, the inRenderFlowThread flags
 11 wasn't being set/reset for the children too.
 12 This is now fixed by calling the new setInRenderFlowThreadRecursive.
 13
 14 The ASSERT was hit for anonymous blocks when detaching the document.
 15
 16 The test starts from such an anonymous block and the detaches the body of document.
 17
 18 * fast/regions/detaching-regions-with-anonymous-blocks-expected.txt: Added.
 19 * fast/regions/detaching-regions-with-anonymous-blocks.html: Added.
 20
1212013-01-29 Ádám Kallai <kadam@inf.u-szeged.hu>
222
323 [Qt] Unreviewed gardening. Skip failing tests after r140927.

LayoutTests/fast/regions/detaching-regions-with-anonymous-blocks-expected.txt

 1Bug 104517: [CSSRegions] Assertion failure in Node::detach (!renderer || renderer->inRenderFlowThread())
 2
 3This test PASSES if it does not CRASH or ASSERT.

LayoutTests/fast/regions/detaching-regions-with-anonymous-blocks.html

 1<!doctype html>
 2<html>
 3 <head>
 4
 5 <!--
 6 This "script" is actually a template and is needed because we must remove the body in order to reproduce the bug.
 7 If the content of this template would be placed in the body, it would be deleted when the body is removed.
 8 -->
 9 <script id="testResult" type="text/template">
 10 <p>Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=104517">104517</a>: [CSSRegions] Assertion failure
 11 in Node::detach (!renderer || renderer->inRenderFlowThread())</p>
 12 <p>This test PASSES if it does not CRASH or ASSERT.</p>
 13 </script>
 14
 15 <script type="text/javascript">
 16 if(window.testRunner){
 17 window.testRunner.dumpAsText();
 18 window.testRunner.waitUntilDone();
 19 }
 20
 21 window.addEventListener("load",function(){
 22 // This previously caused the ASSERT to be hit.
 23 var p = document.body.parentNode;
 24 p.removeChild(document.body);
 25
 26 // Display the human readable test result.
 27 var b = document.createElement("body");
 28 p.appendChild(b);
 29 b.innerHTML = document.getElementById("testResult").innerHTML;
 30
 31 if(window.testRunner)
 32 window.testRunner.notifyDone();
 33 });
 34 </script>
 35
 36 </head>
 37
 38 <body>
 39 <div style="-webkit-flow-into: flow;">
 40 <span>
 41 a <p>b</p> a
 42 </span>
 43 </div>
 44 <div id="region" style="-webkit-flow-from:flow;"></div>
 45 </body>
 46</html>

Source/WebCore/ChangeLog

 12013-01-29 Mihai Maerean <mmaerean@adobe.com>
 2
 3 [CSSRegions] Assertion failure in Node::detach (!renderer || renderer->inRenderFlowThread())
 4 https://bugs.webkit.org/show_bug.cgi?id=104517
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 The RenderObject::inRenderFlowThread bit could have become disconnected from the fact that the RenderObject
 9 has (or not) an enclosing RenderFlowThread.
 10 The cause of this was that, when setting or removing the parent of a RenderObject, the inRenderFlowThread flags
 11 wasn't being set/reset for the children too.
 12 This is now fixed by calling the new setInRenderFlowThreadRecursive.
 13
 14 The ASSERT was hit for anonymous blocks when detaching the document.
 15
 16 Test: fast/regions/detaching-regions-with-anonymous-blocks.html
 17
 18 * rendering/RenderObject.cpp:
 19 (WebCore::RenderObject::setInRenderFlowThreadRecursive):
 20 (WebCore):
 21 * rendering/RenderObject.h:
 22 (WebCore::RenderObject::setParent):
 23 (RenderObject):
 24
1252013-01-29 Andrey Lushnikov <lushnikov@chromium.org>
226
327 Web Inspector: fix bottom span in token highlight in DTE

Source/WebCore/rendering/RenderObject.cpp

@@bool RenderObject::isHTMLMarquee() const
278278 return node() && node()->renderer() == this && node()->hasTagName(marqueeTag);
279279}
280280
 281void RenderObject::setInRenderFlowThreadRecursive(bool b)
 282{
 283 setInRenderFlowThread(b);
 284
 285 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
 286 ASSERT(b != child->inRenderFlowThread());
 287 child->setInRenderFlowThreadRecursive(b);
 288 }
 289}
 290
281291void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild)
282292{
283293 RenderObjectChildList* children = virtualChildren();

Source/WebCore/rendering/RenderObject.h

@@protected:
270270 void setParent(RenderObject* parent)
271271 {
272272 m_parent = parent;
273  if (parent && parent->inRenderFlowThread())
274  setInRenderFlowThread(true);
 273 if (parent && parent->inRenderFlowThread() && !inRenderFlowThread())
 274 setInRenderFlowThreadRecursive(true);
275275 else if (!parent && inRenderFlowThread())
276  setInRenderFlowThread(false);
 276 setInRenderFlowThreadRecursive(false);
277277 }
278278 //////////////////////////////////////////
279279private:

@@public:
434434 bool inRenderFlowThread() const { return m_bitfields.inRenderFlowThread(); }
435435 void setInRenderFlowThread(bool b = true) { m_bitfields.setInRenderFlowThread(b); }
436436
 437 void setInRenderFlowThreadRecursive(bool = true);
 438
437439 virtual bool requiresForcedStyleRecalcPropagation() const { return false; }
438440
439441#if ENABLE(MATHML)