<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>140441</bug_id>
          
          <creation_ts>2015-01-14 07:06:13 -0800</creation_ts>
          <short_desc>[CSSRegions] Assert failure in RenderBlock::locateFlowThreadContainingBlock when showing the render tree debug info</short_desc>
          <delta_ts>2015-01-15 01:04:56 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mihnea Ovidenie">mihnea</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abucur</cc>
    
    <cc>commit-queue</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>glenn</cc>
    
    <cc>hyatt</cc>
    
    <cc>kondapallykalyan</cc>
    
    <cc>WebkitBugTracker</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1061165</commentid>
    <comment_count>0</comment_count>
    <who name="Mihnea Ovidenie">mihnea</who>
    <bug_when>2015-01-14 07:06:13 -0800</bug_when>
    <thetext>While debugging the following test file:
&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;style&gt;
            #article { -webkit-column-count: 2; }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div id=&quot;article&quot;&gt;
            &lt;div id=&quot;target&quot;&gt;
                &lt;div id=&quot;inside&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;script type=&quot;text/javascript&quot;&gt;
            document.body.offsetTop;
            document.getElementById(&quot;target&quot;).style.position = &quot;absolute&quot;;
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;

i noticed that if i placed a breakpoint in RenderBlock::styleDidChange(..) on the line with invalidateFlowThreadContainingBlockIncludingDescendants() and i call showRenderTreeForThis() upon hitting the breakpoint, before the invalidation code is executed, i hit the assert ASSERT(rareData-&gt;m_flowThreadContainingBlock.value() == RenderBox::locateFlowThreadContainingBlock()) inside the RenderBlock::locateFlowThreadContainingBlock() for the element that changed its position from static to absolute.

The reason is that showRenderTreeForThis() uses the RenderObject::showRegionsInformation(..) method which in turn calls flowThreadContainingBlock() for the renderer. However, in this situation, we did not yet invalidate the cached flow thread information and since the element changed its position, it is not contained inside the multicol flow thread anymore and the computation of flow thread containing block issues a different value, hence the assert.

I will fix this assert by changing the showRegionsInformation(..) method to always use the cached flow thread information. I will leave the existing assert in RenderBlock::locateFlowThreadContainingBlock(..) in place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061166</commentid>
    <comment_count>1</comment_count>
      <attachid>244601</attachid>
    <who name="Mihnea Ovidenie">mihnea</who>
    <bug_when>2015-01-14 07:16:06 -0800</bug_when>
    <thetext>Created attachment 244601
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061168</commentid>
    <comment_count>2</comment_count>
      <attachid>244601</attachid>
    <who name="Andrei Bucur">abucur</who>
    <bug_when>2015-01-14 07:21:08 -0800</bug_when>
    <thetext>Comment on attachment 244601
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244601&amp;action=review

&gt; Source/WebCore/rendering/RenderObject.cpp:1398
&gt; +        return downcast&lt;RenderBlock&gt;(*renderer).cachedFlowThreadContainingBlock();

We should also check if the cached value is dirty and return null as well because the value is unreliable.

&gt; Source/WebCore/rendering/RenderObject.cpp:1412
&gt; +            ftcb = flowThreadContainingBlockFromRenderer(containingBlock());

The information in this case may be misleading. Another option would be to display &quot;N/A&quot; instead of some values that may be inaccurate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061169</commentid>
    <comment_count>3</comment_count>
    <who name="Mihnea Ovidenie">mihnea</who>
    <bug_when>2015-01-14 07:33:04 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Comment on attachment 244601 [details]
&gt; patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=244601&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/rendering/RenderObject.cpp:1398
&gt; &gt; +        return downcast&lt;RenderBlock&gt;(*renderer).cachedFlowThreadContainingBlock();
&gt; 
&gt; We should also check if the cached value is dirty and return null as well
&gt; because the value is unreliable.
&gt; 

The current implementation does not have a dirty bit. If the value is dirty, then the cached value is null, which is covered by the proposed code.

&gt; &gt; Source/WebCore/rendering/RenderObject.cpp:1412
&gt; &gt; +            ftcb = flowThreadContainingBlockFromRenderer(containingBlock());
&gt; 
&gt; The information in this case may be misleading. Another option would be to
&gt; display &quot;N/A&quot; instead of some values that may be inaccurate.

In this case, i attempt to retrieve the flow thread containing block for a box from its containing block cached information. If we call showRenderTree* methods before invalidating the cached flow thread information, the displayed information is still appropriate. After invalidating the cached flow thread containing block, we will not display the regions information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061174</commentid>
    <comment_count>4</comment_count>
      <attachid>244601</attachid>
    <who name="Andrei Bucur">abucur</who>
    <bug_when>2015-01-14 08:06:35 -0800</bug_when>
    <thetext>Comment on attachment 244601
patch

Ok, sounds good then, r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061508</commentid>
    <comment_count>5</comment_count>
      <attachid>244601</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-01-15 01:04:40 -0800</bug_when>
    <thetext>Comment on attachment 244601
patch

Clearing flags on attachment: 244601

Committed r178496: &lt;http://trac.webkit.org/changeset/178496&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061509</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-01-15 01:04:56 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>244601</attachid>
            <date>2015-01-14 07:16:06 -0800</date>
            <delta_ts>2015-01-15 01:04:40 -0800</delta_ts>
            <desc>patch</desc>
            <filename>140441.patch</filename>
            <type>text/plain</type>
            <size>3236</size>
            <attacher name="Mihnea Ovidenie">mihnea</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAzOWE0ODBjLi5hZTAwMDczIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMjEg
QEAKKzIwMTUtMDEtMTQgIE1paG5lYSBPdmlkZW5pZSAgPG1paG5lYUBhZG9iZS5jb20+CisKKyAg
ICAgICAgW0NTU1JlZ2lvbnNdIEFzc2VydCBmYWlsdXJlIGluIFJlbmRlckJsb2NrOjpsb2NhdGVG
bG93VGhyZWFkQ29udGFpbmluZ0Jsb2NrIHdoZW4gc2hvd2luZyB0aGUgcmVuZGVyIHRyZWUgZGVi
dWcgaW5mbworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9
MTQwNDQxCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAg
V2hlb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KTsKICAgICB9CisKKyAgICBp
ZiAoIWZ0Y2IpCisgICAgICAgIHJldHVybjsKKworICAgIFJlbmRlclJlZ2lvbiogc3RhcnRSZWdp
b24gPSBudWxscHRyOworICAgIFJlbmRlclJlZ2lvbiogZW5kUmVnaW9uID0gbnVsbHB0cjsKKyAg
ICBmdGNiLT5nZXRSZWdpb25SYW5nZUZvckJveChkb3duY2FzdDxSZW5kZXJCb3g+KHRoaXMpLCBz
dGFydFJlZ2lvbiwgZW5kUmVnaW9uKTsKKyAgICBmcHJpbnRmKHN0ZGVyciwgIiBbUnM6JXAgUmU6
JXBdIiwgc3RhcnRSZWdpb24sIGVuZFJlZ2lvbik7CiB9CiAKIHZvaWQgUmVuZGVyT2JqZWN0Ojpz
aG93UmVuZGVyT2JqZWN0KGJvb2wgbWFyaywgaW50IGRlcHRoKSBjb25zdAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>