Ignore:
Timestamp:
Oct 10, 2013, 6:55:29 AM (12 years ago)
Author:
[email protected]
Message:

Move RenderObject::layout() to RenderElement.
<https://webkit.org/b/122537>

Reviewed by Antti Koivisto.

RenderText will ASSERT_NOT_REACHED() in its layout(), so move this
to RenderElement. This allows us to use the fast firstChild()
instead of virtual dispatch.

The needsLayout() bit remains on RenderObject for now. Moving that
to RenderElement is a far more involved change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r156876 r157222  
    5555#include "SVGRenderSupport.h"
    5656#include "StyleResolver.h"
     57#include <wtf/StackStats.h>
    5758
    5859#if USE(ACCELERATED_COMPOSITING)
     
    10731074}
    10741075
    1075 }
     1076void RenderElement::layout()
     1077{
     1078    StackStats::LayoutCheckPoint layoutCheckPoint;
     1079    ASSERT(needsLayout());
     1080    RenderObject* child = firstChild();
     1081    while (child) {
     1082        if (child->needsLayout())
     1083            toRenderElement(child)->layout();
     1084        ASSERT(!child->needsLayout());
     1085        child = child->nextSibling();
     1086    }
     1087    clearNeedsLayout();
     1088}
     1089
     1090}
Note: See TracChangeset for help on using the changeset viewer.