Changeset 74292 in webkit


Ignore:
Timestamp:
Dec 17, 2010 1:39:19 PM (13 years ago)
Author:
carol.szabo@nokia.com
Message:

2010-12-17 Carol Szabo <carol.szabo@nokia.com>

Reviewed by Darin Adler.

A corrupted counter tree is created when renderers are added to the
tree bypassing RenderObject::addChild
https://bugs.webkit.org/show_bug.cgi?id=51270

This patch replaces the hack introduced for fixing bug 43812
with code that addresses the underlying problem for that bug.
No new layout tests provided as there is no identified scenario when
visible behavior would be different, the internal datastructures
are maintained properly through this fix so the previous hack
introduced for bug 43812 is now removed. The fact that the
layout test introduced for 43812 continues to pass is proof that the
code works.

  • rendering/RenderCounter.cpp: (WebCore::findPlaceForCounter): Removed hack.
  • rendering/RenderObject.cpp: (WebCore::RenderObject::addChild): Moved call to counter nodes updater to lower level functions to avoid bypass.
  • rendering/RenderObjectChildList.cpp: (WebCore::RenderObjectChildList::appendChildNode): (WebCore::RenderObjectChildList::insertChildNode): Changed to update the values of the counters that may be inserted in the tree.
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74288 r74292  
     12010-12-17  Carol Szabo  <carol.szabo@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        A corrupted counter tree is created when renderers are added to the
     6        tree bypassing RenderObject::addChild
     7        https://bugs.webkit.org/show_bug.cgi?id=51270
     8
     9        This patch replaces the hack introduced for fixing bug 43812
     10        with code that addresses the underlying problem for that bug.
     11        No new layout tests provided as there is no identified scenario when
     12        visible behavior would be different, the internal datastructures
     13        are maintained properly through this fix so the previous hack
     14        introduced for bug 43812 is now removed. The fact that the
     15        layout test introduced for 43812 continues to pass is proof that the
     16        code works.
     17
     18        * rendering/RenderCounter.cpp:
     19        (WebCore::findPlaceForCounter):
     20          Removed hack.
     21        * rendering/RenderObject.cpp:
     22        (WebCore::RenderObject::addChild):
     23          Moved call to counter nodes updater to lower level
     24          functions to avoid bypass.
     25        * rendering/RenderObjectChildList.cpp:
     26        (WebCore::RenderObjectChildList::appendChildNode):
     27        (WebCore::RenderObjectChildList::insertChildNode):
     28          Changed to update the values of the counters that
     29          may be inserted in the tree.
     30
    1312010-12-17  Shimeng (Simon) Wang  <swang@google.com>
    232
  • trunk/WebCore/rendering/RenderCounter.cpp

    r69437 r74292  
    137137    previousSibling = 0;
    138138    while (currentRenderer) {
    139         // A sibling without a parent means that the counter node tree was not constructed correctly so we stop
    140         // traversing. In the future RenderCounter should handle RenderObjects that are not connected to the
    141         // render tree at counter node creation. See bug 43812.
    142         if (previousSibling && !previousSibling->parent())
    143             return false;
    144139        CounterNode* currentCounter = makeCounterNode(currentRenderer, identifier, false);
    145140        if (searchEndRenderer == currentRenderer) {
  • trunk/WebCore/rendering/RenderObject.cpp

    r74281 r74292  
    316316        children->insertChildNode(this, newChild, beforeChild);
    317317    }
    318     RenderCounter::rendererSubtreeAttached(newChild);
    319318    if (newChild->isText() && newChild->style()->textTransform() == CAPITALIZE) {
    320319        RefPtr<StringImpl> textToTransform = toRenderText(newChild)->originalText();
  • trunk/WebCore/rendering/RenderObjectChildList.cpp

    r68860 r74292  
    175175    }
    176176
     177    RenderCounter::rendererSubtreeAttached(newChild);
    177178    newChild->setNeedsLayoutAndPrefWidthsRecalc(); // Goes up the containing block hierarchy.
    178179    if (!owner->normalChildNeedsLayout())
     
    234235    }
    235236
     237    RenderCounter::rendererSubtreeAttached(child);
    236238    child->setNeedsLayoutAndPrefWidthsRecalc();
    237239    if (!owner->normalChildNeedsLayout())
Note: See TracChangeset for help on using the changeset viewer.