Changeset 156308 in webkit


Ignore:
Timestamp:
Sep 23, 2013, 4:55:20 PM (12 years ago)
Author:
akling@apple.com
Message:

CTTE: RenderObject::container() should return a RenderElement*.
<https://webkit.org/b/121811>

Reviewed by Antti Koivisto.

The containing renderer is always a RenderElement.

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156307 r156308  
     12013-09-23  Andreas Kling  <akling@apple.com>
     2
     3        CTTE: RenderObject::container() should return a RenderElement*.
     4        <https://webkit.org/b/121811>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The containing renderer is always a RenderElement.
     9
    1102013-09-23  Anders Carlsson  <andersca@apple.com>
    211
  • trunk/Source/WebCore/rendering/LayoutState.cpp

    r155944 r156308  
    5858
    5959    if (renderer->isOutOfFlowPositioned() && !fixed) {
    60         if (RenderObject* container = renderer->container()) {
     60        if (RenderElement* container = renderer->container()) {
    6161            if (container->isInFlowPositioned() && container->isRenderInline())
    6262                m_paintOffset += toRenderInline(container)->offsetForInFlowPositionedInline(renderer);
     
    157157#endif
    158158{
    159     RenderObject* container = root->container();
     159    RenderElement* container = root->container();
    160160    FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), UseTransforms);
    161161    m_paintOffset = LayoutSize(absContentPoint.x(), absContentPoint.y());
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r156199 r156308  
    991991    // FIXME: The math here is actually not really right. It's a best-guess approximation that
    992992    // will work for the common cases
    993     RenderObject* containerBlock = child->container();
     993    RenderElement* containerBlock = child->container();
    994994    LayoutUnit blockHeight = block->logicalHeight();
    995995    if (containerBlock->isRenderInline()) {
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r156297 r156308  
    18171817
    18181818    bool containerSkipped;
    1819     RenderObject* o = container(repaintContainer, &containerSkipped);
     1819    RenderElement* o = container(repaintContainer, &containerSkipped);
    18201820    if (!o)
    18211821        return;
     
    18661866
    18671867    bool ancestorSkipped;
    1868     RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped);
     1868    RenderElement* container = this->container(ancestorToStopAt, &ancestorSkipped);
    18691869    if (!container)
    18701870        return 0;
     
    20732073
    20742074    bool containerSkipped;
    2075     RenderObject* o = container(repaintContainer, &containerSkipped);
     2075    RenderElement* o = container(repaintContainer, &containerSkipped);
    20762076    if (!o)
    20772077        return;
     
    30743074    if (child->parent()->style()->direction() == LTR) {
    30753075        LayoutUnit staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft();
    3076         for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
     3076        for (RenderElement* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
    30773077            if (curr->isBox()) {
    30783078                staticPosition += toRenderBox(curr)->logicalLeft();
     
    30903090        RenderBox* enclosingBox = child->parent()->enclosingBox();
    30913091        LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalLeft();
    3092         for (RenderObject* curr = enclosingBox; curr; curr = curr->container()) {
     3092        for (RenderElement* curr = enclosingBox; curr; curr = curr->container()) {
    30933093            if (curr->isBox()) {
    30943094                if (curr != containerBlock)
     
    34483448    // FIXME: The static distance computation has not been patched for mixed writing modes.
    34493449    LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore();
    3450     for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
     3450    for (RenderElement* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
    34513451        if (curr->isBox() && !curr->isTableRow())
    34523452            staticLogicalTop += toRenderBox(curr)->logicalTop();
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r156278 r156308  
    27352735void RenderBoxModelObject::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState& transformState) const
    27362736{
    2737     RenderObject* o = container();
     2737    RenderElement* o = container();
    27382738    if (!o)
    27392739        return;
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r156278 r156308  
    11061106
    11071107    bool containerSkipped;
    1108     RenderObject* o = container(repaintContainer, &containerSkipped);
     1108    RenderElement* o = container(repaintContainer, &containerSkipped);
    11091109    if (!o)
    11101110        return;
     
    11861186
    11871187    bool containerSkipped;
    1188     RenderObject* o = container(repaintContainer, &containerSkipped);
     1188    RenderElement* o = container(repaintContainer, &containerSkipped);
    11891189    if (!o)
    11901190        return;
     
    12241224
    12251225    bool ancestorSkipped;
    1226     RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped);
     1226    RenderElement* container = this->container(ancestorToStopAt, &ancestorSkipped);
    12271227    if (!container)
    12281228        return 0;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r156291 r156308  
    22782278        return hasCoordinatedScrolling() && isViewportConstrainedFixedOrStickyLayer(layer);
    22792279
    2280     RenderObject* container = renderer->container();
     2280    RenderElement* container = renderer->container();
    22812281    // If the renderer is not hooked up yet then we have to wait until it is.
    22822282    if (!container) {
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r156285 r156308  
    658658    ASSERT(!isSetNeedsLayoutForbidden());
    659659
    660     RenderObject* object = container();
     660    RenderElement* object = container();
    661661    RenderObject* last = this;
    662662
     
    671671        // Don't mark the outermost object of an unrooted subtree. That object will be
    672672        // marked when the subtree is added to the document.
    673         RenderObject* container = object->container();
     673        RenderElement* container = object->container();
    674674        if (!container && !object->isRenderView())
    675675            return;
     
    22512251    const RenderObject* currContainer = this;
    22522252    do {
    2253         RenderObject* nextContainer = currContainer->container();
     2253        RenderElement* nextContainer = currContainer->container();
    22542254        ASSERT(nextContainer);  // This means we reached the top without finding container.
    22552255        if (!nextContainer)
     
    23272327}
    23282328
    2329 RenderObject* RenderObject::container(const RenderLayerModelObject* repaintContainer, bool* repaintContainerSkipped) const
     2329RenderElement* RenderObject::container(const RenderLayerModelObject* repaintContainer, bool* repaintContainerSkipped) const
    23302330{
    23312331    if (repaintContainerSkipped)
     
    23412341    // the layout of the positioned object.  This does mean that computePositionedLogicalWidth and
    23422342    // computePositionedLogicalHeight have to use container().
    2343     RenderObject* o = parent();
     2343    RenderElement* o = parent();
    23442344
    23452345    if (isText())
  • trunk/Source/WebCore/rendering/RenderObject.h

    r156285 r156308  
    631631    // If repaintContainer and repaintContainerSkipped are not null, on return *repaintContainerSkipped
    632632    // is true if the renderer returned is an ancestor of repaintContainer.
    633     RenderObject* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const;
     633    RenderElement* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const;
    634634
    635635    virtual RenderObject* hoverAncestor() const;
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r155460 r156308  
    876876    const RenderObject* renderer = partRenderer;
    877877    while (renderer && renderer != inputRenderer) {
    878         RenderObject* containingRenderer = renderer->container();
     878        RenderElement* containingRenderer = renderer->container();
    879879        offsetFromInputRenderer -= roundedIntSize(renderer->offsetFromContainer(containingRenderer, LayoutPoint()));
    880880        renderer = containingRenderer;
Note: See TracChangeset for help on using the changeset viewer.