Bug 54597 - InspectorAgent calls offsetWidth in the middle of painting
Summary: InspectorAgent calls offsetWidth in the middle of painting
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 15:44 PST by Simon Fraser (smfr)
Modified: 2011-02-28 03:24 PST (History)
1 user (show)

See Also:


Attachments
Patch (5.13 KB, patch)
2011-02-26 07:03 PST, Pavel Feldman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2011-02-16 15:44:19 PST
I just hit this assertion:


ASSERTION FAILED: !view() || (!view()->isInLayout() && !view()->isPainting())
/Volumes/InternalData/Development/webkit/OpenSource/Source/WebCore/dom/Document.cpp(1554) : virtual void WebCore::Document::updateStyleIfNeeded()
 -> WebCore::Document::updateStyleIfNeeded()
 -> WebCore::Document::updateLayout()
 -> WebCore::Document::updateLayoutIgnorePendingStylesheets()
 -> WebCore::Element::offsetWidth()
 -> WebCore::InspectorAgent::drawElementTitle(WebCore::GraphicsContext&, WebCore::IntRect const&, WebCore::FloatRect const&, WebCore::Settings*) const
 -> WebCore::InspectorAgent::drawNodeHighlight(WebCore::GraphicsContext&) const
 -> WebCore::InspectorController::drawNodeHighlight(WebCore::GraphicsContext&) const
 -> -[WebNodeHighlightView drawRect:]
 -> -[NSView _drawRect:clip:]
 -> -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
 -> -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
 -> -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
 -> -[NSNextStepFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
 -> -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
 -> -[NSView displayIfNeeded]
 -> -[WebNodeHighlight setNeedsUpdateInTargetViewRect:]
 -> -[WebHTMLView drawSingleRect:]
 -> -[WebHTMLView drawRect:]
 -> -[NSView _drawRect:clip:]
 -> -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
 -> -[WebHTMLView(WebPrivate) _recursiveDisplayAllDirtyWithLockFocus:visRect:]
 -> -[NSView _recursiveDisplaySelfAndDescendantsInRect:]
 -> -[NSView _recursiveDisplayDescendantsInRect:]
 -> -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
 -> -[NSView _recursiveDisplaySelfAndDescendantsInRect:]
 -> -[NSView _recursiveDisplayDescendantsInRect:]
 -> -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
 -> -[NSView _recursiveDisplaySelfAndDescendantsInRect:]
 -> -[NSView _recursiveDisplayDescendantsInRect:]
 -> -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
 -> -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]

InspectorAgent::drawElementTitle() does:
    nodeTitle += String::number(highlightedElement ? highlightedElement->offsetWidth() : boundingBox.width());

Calling offsetWidth in the middle of painting is not allowed, because it can cause layout to happen.
Comment 1 Pavel Feldman 2011-02-26 07:03:13 PST
Created attachment 83938 [details]
Patch
Comment 2 Pavel Feldman 2011-02-28 03:24:19 PST
Comment on attachment 83938 [details]
Patch

Clearing flags on attachment: 83938

Committed r79850: <http://trac.webkit.org/changeset/79850>
Comment 3 Pavel Feldman 2011-02-28 03:24:27 PST
All reviewed patches have been landed.  Closing bug.