<?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>38206</bug_id>
          
          <creation_ts>2010-04-27 11:00:29 -0700</creation_ts>
          <short_desc>FrameView::paintContents() incorrectly bails if needsLayout() is true sometimes</short_desc>
          <delta_ts>2010-10-06 05:24:12 -0700</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>All</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>32381</dup_id>
          
          <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="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Simon Fraser (smfr)">simon.fraser</assigned_to>
          <cc>mitz</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>217792</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-04-27 11:00:29 -0700</bug_when>
    <thetext>FrameView::paintContents() asserts, and then bails if FrameView::needsLayout() is true, with the assumption that said layout will happen soon, and do whatever repainting it needs to. It also assumes that the -viewWillDraw machinery will ensure that layout has always happened before painting.

Note that FrameView&apos;s needsLayout() is more inclusive than root-&gt;needsLayout(); it also checks for childNeedsStyleRecalc() and needsReapplyStyles().

http://trac.webkit.org/changeset/57919 introduced a change that causes setNeedsStyleRecalc() on a node in the middle of a -viewWillDraw call, which happens on a stack that looks like this:

#0  WebCore::RenderView::compositingStateChanged (this=0x122bfb5a8) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderView.cpp:718
#1  0x0000000102d787cf in WebCore::RenderLayerCompositor::enableCompositingMode (this=0x122bfb730, enable=true) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderLayerCompositor.cpp:121
#2  0x0000000102d78809 in WebCore::RenderLayerCompositor::updateBacking (this=0x122bfb730, layer=0x106d1d1f8, shouldRepaint=WebCore::RenderLayerCompositor::CompositingChangeRepaintNow) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderLayerCompositor.cpp:257
#3  0x0000000102d789fd in WebCore::RenderLayerCompositor::updateLayerCompositingState (this=0x122bfb730, layer=0x106d1d1f8, shouldRepaint=WebCore::RenderLayerCompositor::CompositingChangeRepaintNow) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderLayerCompositor.cpp:310
#4  0x0000000102d67ff6 in WebCore::RenderLayer::styleChanged (this=0x106d1d1f8, diff=WebCore::StyleDifferenceEqual) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderLayer.cpp:3472
#5  0x0000000102d35214 in WebCore::RenderBoxModelObject::styleDidChange (this=0x10997ce18, diff=WebCore::StyleDifferenceEqual, oldStyle=0x1241e7bb0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderBoxModelObject.cpp:297
#6  0x0000000102d2d002 in WebCore::RenderBox::styleDidChange (this=0x10997ce18, diff=WebCore::StyleDifferenceEqual, oldStyle=0x1241e7bb0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderBox.cpp:165
#7  0x0000000102d9ec11 in WebCore::RenderReplaced::styleDidChange (this=0x10997ce18, diff=WebCore::StyleDifferenceEqual, oldStyle=0x1241e7bb0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderReplaced.cpp:60
#8  0x0000000102e0239f in WebCore::RenderWidget::styleDidChange (this=0x10997ce18, diff=WebCore::StyleDifferenceEqual, oldStyle=0x1241e7bb0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderWidget.cpp:209
#9  0x0000000102d94d78 in WebCore::RenderObject::setStyle (this=0x10997ce18, style=@0x7fff5fbfbc60) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderObject.cpp:1536
#10 0x0000000102d9294a in WebCore::RenderObject::setAnimatableStyle (this=0x10997ce18, style=@0x7fff5fbfbca0) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/rendering/RenderObject.cpp:1470
#11 0x0000000102c7bd33 in WebCore::Node::setRenderStyle (this=0x1241920a0, s=@0x7fff5fbfbd00) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Node.cpp:1430
#12 0x00000001027c44ed in WebCore::Element::recalcStyle (this=0x1241920a0, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:956
#13 0x00000001028ee964 in WebCore::HTMLObjectElement::recalcStyle (this=0x1241920a0, ch=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/html/HTMLObjectElement.cpp:219
#14 0x00000001027c474d in WebCore::Element::recalcStyle (this=0x1099925c0, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:979
#15 0x00000001027c474d in WebCore::Element::recalcStyle (this=0x109984050, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:979
#16 0x00000001027c474d in WebCore::Element::recalcStyle (this=0x1099924f0, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:979
#17 0x00000001027c474d in WebCore::Element::recalcStyle (this=0x1099927f0, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:979
#18 0x00000001027c474d in WebCore::Element::recalcStyle (this=0x1225f8490, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:979
#19 0x00000001027c474d in WebCore::Element::recalcStyle (this=0x122ba42b0, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:979
#20 0x00000001027c474d in WebCore::Element::recalcStyle (this=0x12232e050, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Element.cpp:979
#21 0x00000001026cd6c5 in WebCore::Document::recalcStyle (this=0x11c9a8a00, change=WebCore::Node::NoChange) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/dom/Document.cpp:1373
#22 0x000000010283a72a in WebCore::FrameView::layout (this=0x123f80620, allowSubtree=true) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/page/FrameView.cpp:606
#23 0x000000010283b22b in WebCore::FrameView::forceLayout (this=0x123f80620, allowSubtree=true) at /Volumes/InternalData/Development/webkit/OpenSource/WebCore/page/FrameView.cpp:1906
#24 0x0000000101fe4e32 in -[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:] (self=0x123f801b0, _cmd=0x7fff84a2e761, minPageWidth=0, maxPageWidth=0, adjustViewSize=0 &apos;\0&apos;) at /Volumes/InternalData/Development/webkit/OpenSource/WebKit/mac/WebView/WebHTMLView.mm:3097
#25 0x0000000101fd728c in -[WebHTMLView layout] (self=0x123f801b0, _cmd=0x7fff865f362b) at /Volumes/InternalData/Development/webkit/OpenSource/WebKit/mac/WebView/WebHTMLView.mm:3111
#26 0x0000000101fdbe9c in -[WebHTMLView(WebInternal) _layoutIfNeeded] (self=0x123f801b0, _cmd=0x7fff84a2c6db) at /Volumes/InternalData/Development/webkit/OpenSource/WebKit/mac/WebView/WebHTMLView.mm:5452
#27 0x0000000101fd4706 in -[WebHTMLView(WebInternal) _web_layoutIfNeededRecursive] (self=0x1241dc050, _cmd=0x7fff84a2c6be) at /Volumes/InternalData/Development/webkit/OpenSource/WebKit/mac/WebView/WebHTMLView.mm:5469
#28 0x0000000101fdb8ad in -[WebHTMLView(WebPrivate) viewWillDraw] (self=0x1241dc050, _cmd=0x7fff865ff778) at /Volumes/InternalData/Development/webkit/OpenSource/WebKit/mac/WebView/WebHTMLView.mm:1268
#29 0x00007fff85f6a172 in -[NSView viewWillDraw] ()
#30 0x00007fff85f6a172 in -[NSView viewWillDraw] ()

This causes needsLayout() to return true, and thus paintContents() to bail. However, there&apos;s no guarantee that the subsequent recalcStyle() will result in any layout or repaints, so we end up unpainted. In debug builds, we end up with a red background.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>286527</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-09-28 14:21:48 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/58320  removed RenderView::compositingStateChanged(). This bug may no longer be applicable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>290223</commentid>
    <comment_count>2</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2010-10-06 05:24:12 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 32381 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>