⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 117759 in webkit


Ignore:
Timestamp:
May 21, 2012, 3:48:40 AM (14 years ago)
Author:
kov@webkit.org
Message:

Merge 113497 - Virtualize createAnonymousBoxWithSameTypeAs. https://bugs.webkit.org/show_bug.cgi?id=83229

Reviewed by Julien Chaffraix.

This helps to use the same function to create anonymous
table parts and in the future extend to more classes
derived from RenderBox.

The current switch case situation was going to be messy as
we will need to mix cases that were very dependent on the
class, so it made sense to add a virtual function.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::splitAnonymousBlocksAroundChild):
(WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs):

  • rendering/RenderBlock.h:

(RenderBlock):

  • rendering/RenderBox.h:

(WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
(RenderBox):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::splitFlow):

  • rendering/RenderTable.h:

(WebCore::RenderTable::createAnonymousBoxWithSameTypeAs):

  • rendering/RenderTableCell.h:

(WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs):

  • rendering/RenderTableRow.h:

(WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs):

  • rendering/RenderTableSection.h:

(WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs):

Conflicts:

Source/WebCore/rendering/RenderBox.h

Location:
releases/WebKitGTK/webkit-1.8/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog

    r117758 r117759  
     12012-04-06  Abhishek Arya  <inferno@chromium.org>
     2
     3        Virtualize createAnonymousBoxWithSameTypeAs.
     4        https://bugs.webkit.org/show_bug.cgi?id=83229
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        This helps to use the same function to create anonymous
     9        table parts and in the future extend to more classes
     10        derived from RenderBox.
     11
     12        The current switch case situation was going to be messy as
     13        we will need to mix cases that were very dependent on the
     14        class, so it made sense to add a virtual function.
     15
     16        * rendering/RenderBlock.cpp:
     17        (WebCore::RenderBlock::splitAnonymousBlocksAroundChild):
     18        (WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs):
     19        * rendering/RenderBlock.h:
     20        (RenderBlock):
     21        * rendering/RenderBox.h:
     22        (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
     23        (RenderBox):
     24        * rendering/RenderInline.cpp:
     25        (WebCore::RenderInline::splitFlow):
     26        * rendering/RenderTable.h:
     27        (WebCore::RenderTable::createAnonymousBoxWithSameTypeAs):
     28        * rendering/RenderTableCell.h:
     29        (WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs):
     30        * rendering/RenderTableRow.h:
     31        (WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs):
     32        * rendering/RenderTableSection.h:
     33        (WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs):
     34
    1352012-04-04  Abhishek Arya  <inferno@chromium.org>
    236
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.cpp

    r117758 r117759  
    607607        if (blockToSplit->firstChild() != beforeChild) {
    608608            // We have to split the parentBlock into two blocks.
    609             RenderBlock* post = createAnonymousBlockWithSameTypeAs(blockToSplit);
     609            RenderBlock* post = toRenderBlock(blockToSplit->createAnonymousBoxWithSameTypeAs(this));
    610610            post->setChildrenInline(blockToSplit->childrenInline());
    611611            RenderBlock* parentBlock = toRenderBlock(blockToSplit->parent());
     
    64676467}
    64686468
    6469 RenderBlock* RenderBlock::createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const
    6470 {
    6471     if (otherAnonymousBlock->isAnonymousColumnsBlock())
    6472         return createAnonymousColumnsBlock();
    6473     if (otherAnonymousBlock->isAnonymousColumnSpanBlock())
    6474         return createAnonymousColumnSpanBlock();
    6475     return createAnonymousBlock(otherAnonymousBlock->style()->display());
     6469RenderBox* RenderBlock::createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const
     6470{
     6471    if (isAnonymousColumnsBlock())
     6472        return createAnonymousColumnsWithParentRenderer(parent);
     6473    if (isAnonymousColumnSpanBlock())
     6474        return createAnonymousColumnSpanWithParentRenderer(parent);
     6475    return createAnonymousWithParentRendererAndDisplay(parent, style()->display());
    64766476}
    64776477
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBlock.h

    r117758 r117759  
    228228    RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); }
    229229
    230     RenderBlock* createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const;
     230    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE;
    231231   
    232232    static void appendRunsForObject(BidiRunList<BidiRun>&, int start, int end, RenderObject*, InlineBidiResolver&);
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderBox.h

    r107880 r117759  
    446446    virtual void computeIntrinsicRatioInformation(FloatSize& /* intrinsicSize */, double& /* intrinsicRatio */, bool& /* isPercentageIntrinsicSize */) const { }
    447447
     448    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject*) const
     449    {
     450        ASSERT_NOT_REACHED();
     451        return 0;
     452    }
     453
    448454protected:
    449455    virtual void willBeDestroyed();
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderInline.cpp

    r108185 r117759  
    427427    }
    428428
    429     RenderBlock* post = block->createAnonymousBlockWithSameTypeAs(pre);
     429    RenderBlock* post = toRenderBlock(pre->createAnonymousBoxWithSameTypeAs(block));
    430430
    431431    RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTable.h

    r117758 r117759  
    213213
    214214    static RenderTable* createAnonymousWithParentRenderer(const RenderObject*);
     215    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
     216    {
     217        return createAnonymousWithParentRenderer(parent);
     218    }
    215219
    216220protected:
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableCell.h

    r117758 r117759  
    138138
    139139    static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*);
     140    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
     141    {
     142        return createAnonymousWithParentRenderer(parent);
     143    }
    140144
    141145protected:
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableRow.h

    r117758 r117759  
    4444
    4545    static RenderTableRow* createAnonymousWithParentRenderer(const RenderObject*);
     46    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
     47    {
     48        return createAnonymousWithParentRenderer(parent);
     49    }
    4650
    4751private:
  • releases/WebKitGTK/webkit-1.8/Source/WebCore/rendering/RenderTableSection.h

    r117758 r117759  
    143143
    144144    static RenderTableSection* createAnonymousWithParentRenderer(const RenderObject*);
     145    virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
     146    {
     147        return createAnonymousWithParentRenderer(parent);
     148    }
    145149
    146150protected:
Note: See TracChangeset for help on using the changeset viewer.