Bug 38206 - FrameView::paintContents() incorrectly bails if needsLayout() is true sometimes
Summary: FrameView::paintContents() incorrectly bails if needsLayout() is true sometimes
Status: RESOLVED DUPLICATE of bug 32381
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-27 11:00 PDT by Simon Fraser (smfr)
Modified: 2010-10-06 05:24 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2010-04-27 11:00:29 PDT
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's needsLayout() is more inclusive than root->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 '\0') 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'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.
Comment 1 Simon Fraser (smfr) 2010-09-28 14:21:48 PDT
http://trac.webkit.org/changeset/58320  removed RenderView::compositingStateChanged(). This bug may no longer be applicable.
Comment 2 Nikolas Zimmermann 2010-10-06 05:24:12 PDT

*** This bug has been marked as a duplicate of bug 32381 ***