Changeset 20385 in webkit


Ignore:
Timestamp:
Mar 22, 2007 2:13:13 AM (17 years ago)
Author:
hyatt
Message:

Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
Have the bridge talk through the FrameView instead of just asking for the RenderView directly.

Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.

Reviewed by aroben

  • page/FrameView.cpp: (WebCore::FrameView::adjustViewSize): (WebCore::FrameView::needsLayout): (WebCore::FrameView::setNeedsLayout):
  • page/FrameView.h:
  • page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge needsLayout]): (-[WebCoreFrameBridge setNeedsLayout]):
  • rendering/RenderView.cpp: (WebCore::RenderView::paint):
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r20384 r20385  
     12007-03-22  David Hyatt  <hyatt@apple.com>
     2
     3        Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
     4        Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
     5
     6        Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
     7        catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
     8
     9        Reviewed by aroben
     10
     11        * page/FrameView.cpp:
     12        (WebCore::FrameView::adjustViewSize):
     13        (WebCore::FrameView::needsLayout):
     14        (WebCore::FrameView::setNeedsLayout):
     15        * page/FrameView.h:
     16        * page/mac/WebCoreFrameBridge.mm:
     17        (-[WebCoreFrameBridge needsLayout]):
     18        (-[WebCoreFrameBridge setNeedsLayout]):
     19        * rendering/RenderView.cpp:
     20        (WebCore::RenderView::paint):
     21
    1222007-03-21  Geoffrey Garen  <ggaren@apple.com>
    223
  • trunk/WebCore/page/FrameView.cpp

    r20360 r20385  
    218218{
    219219    ASSERT(m_frame->view() == this);
    220     if (Document* document = m_frame->document()) {
    221         RenderView* root = static_cast<RenderView*>(document->renderer());
    222         if (!root)
    223             return;
    224         resizeContents(root->overflowWidth(), root->overflowHeight());
    225     }
     220    RenderView* root = static_cast<RenderView*>(m_frame->renderer());
     221    if (!root)
     222        return;
     223    resizeContents(root->overflowWidth(), root->overflowHeight());
    226224}
    227225
     
    698696}
    699697
     698bool FrameView::needsLayout() const
     699{
     700    return layoutPending();
     701}
     702
     703void FrameView::setNeedsLayout()
     704{
     705    if (m_frame->renderer())
     706        m_frame->renderer()->setNeedsLayout(true);
     707}
     708
    700709bool FrameView::haveDelayedLayoutScheduled()
    701710{
  • trunk/WebCore/page/FrameView.h

    r20360 r20385  
    8585    int layoutCount() const;
    8686
     87    // These two helper functions just pass through to the RenderView.
     88    bool needsLayout() const;
     89    void setNeedsLayout();
     90
    8791    bool needsFullRepaint() const;
    8892    void repaintRectangle(const IntRect&, bool immediate);
  • trunk/WebCore/page/mac/WebCoreFrameBridge.mm

    r20324 r20385  
    770770- (BOOL)needsLayout
    771771{
    772     FrameView* view = m_frame->view();
    773     return view ? view->layoutPending() : false;
     772    return m_frame->view() ? m_frame->view()->needsLayout() : false;
    774773}
    775774
    776775- (void)setNeedsLayout
    777776{
    778     RenderObject *renderer = m_frame->renderer();
    779     if (renderer)
    780         renderer->setNeedsLayout(true);
     777    if (m_frame->view())
     778        m_frame->view()->setNeedsLayout();
    781779}
    782780
  • trunk/WebCore/rendering/RenderView.cpp

    r20380 r20385  
    129129void RenderView::paint(PaintInfo& paintInfo, int tx, int ty)
    130130{
     131    // If we ever require layout but receive a paint anyway, something has gone horribly wrong.
     132    ASSERT(!needsLayout());
     133
    131134    // Cache the print rect because the dirty rect could get changed during painting.
    132135    if (printing())
Note: See TracChangeset for help on using the changeset viewer.