Changeset 89304 in webkit


Ignore:
Timestamp:
Jun 20, 2011 4:14:23 PM (13 years ago)
Author:
jchaffraix@webkit.org
Message:

2011-06-20 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Darin Adler.

Remove some unsafe static_cast in rendering/
https://bugs.webkit.org/show_bug.cgi?id=63014

Mechanical refactoring, no test needed.

  • rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::placeBoxesInBlockDirection): (WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
  • rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::getEmphasisMarkPosition):
  • rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::LineBreaker::nextLineBreak):
  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::destroyScrollbar):
  • rendering/RenderRuby.cpp: (WebCore::rubyBeforeBlock): (WebCore::rubyAfterBlock): (WebCore::lastRubyRun): (WebCore::findRubyRunParent):
  • rendering/RenderRubyBase.cpp: (WebCore::RenderRubyBase::rubyRun):
  • rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::removeChild): Use the proper conversion methods at the previous call-sites.
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89303 r89304  
     12011-06-20  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Remove some unsafe static_cast in rendering/
     6        https://bugs.webkit.org/show_bug.cgi?id=63014
     7
     8        Mechanical refactoring, no test needed.
     9
     10        * rendering/InlineFlowBox.cpp:
     11        (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
     12        (WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
     13        * rendering/InlineTextBox.cpp:
     14        (WebCore::InlineTextBox::getEmphasisMarkPosition):
     15        * rendering/RenderBlockLineLayout.cpp:
     16        (WebCore::RenderBlock::LineBreaker::nextLineBreak):
     17        * rendering/RenderLayer.cpp:
     18        (WebCore::RenderLayer::destroyScrollbar):
     19        * rendering/RenderRuby.cpp:
     20        (WebCore::rubyBeforeBlock):
     21        (WebCore::rubyAfterBlock):
     22        (WebCore::lastRubyRun):
     23        (WebCore::findRubyRunParent):
     24        * rendering/RenderRubyBase.cpp:
     25        (WebCore::RenderRubyBase::rubyRun):
     26        * rendering/RenderRubyRun.cpp:
     27        (WebCore::RenderRubyRun::removeChild):
     28        Use the proper conversion methods at the previous call-sites.
     29
    1302011-06-20  Anders Carlsson  <andersca@apple.com>
    231
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r88526 r89304  
    647647                    hasAnnotationsAfter = true;
    648648
    649                 RenderRubyRun* rubyRun = static_cast<RenderRubyRun*>(curr->renderer());
     649                RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer());
    650650                if (RenderRubyBase* rubyBase = rubyRun->rubyBase()) {
    651651                    int bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : 0);
     
    13091309       
    13101310        if (curr->renderer()->isReplaced() && curr->renderer()->isRubyRun()) {
    1311             RenderRubyRun* rubyRun = static_cast<RenderRubyRun*>(curr->renderer());
     1311            RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer());
    13121312            RenderRubyText* rubyText = rubyRun->rubyText();
    13131313            if (!rubyText)
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r88613 r89304  
    453453        return true; // Cannot get the ruby text.
    454454
    455     RenderRubyText* rubyText = static_cast<RenderRubyRun*>(containingBlock->parent())->rubyText();
     455    RenderRubyText* rubyText = toRenderRubyRun(containingBlock->parent())->rubyText();
    456456
    457457    // The emphasis marks over are suppressed only if there is a ruby text box and it not empty.
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r88913 r89304  
    22552255                if (isSVGText && current.m_pos > 0) {
    22562256                    // Force creation of new InlineBoxes for each absolute positioned character (those that start new text chunks).
    2257                     if (static_cast<RenderSVGInlineText*>(t)->characterStartsNewTextChunk(current.m_pos)) {
     2257                    if (toRenderSVGInlineText(t)->characterStartsNewTextChunk(current.m_pos)) {
    22582258                        addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, current.m_pos - 1));
    22592259                        addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, current.m_pos));
     
    22732273
    22742274                if (collapseWhiteSpace && currentCharacterIsSpace && !ignoringSpaces)
    2275                     trailingObjects.setTrailingWhitespace(static_cast<RenderText*>(current.m_obj));
     2275                    trailingObjects.setTrailingWhitespace(toRenderText(current.m_obj));
    22762276                else if (!current.m_obj->style()->collapseWhiteSpace() || !currentCharacterIsSpace)
    22772277                    trailingObjects.clear();
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r88982 r89304  
    19041904    if (scrollbar) {
    19051905        if (scrollbar->isCustomScrollbar())
    1906             static_cast<RenderScrollbar*>(scrollbar.get())->clearOwningRenderer();
     1906            toRenderScrollbar(scrollbar.get())->clearOwningRenderer();
    19071907        else {
    19081908            if (orientation == HorizontalScrollbar)
  • trunk/Source/WebCore/rendering/RenderRuby.cpp

    r83787 r89304  
    5353{
    5454    RenderObject* child = ruby->firstChild();
    55     return child && !child->isRubyRun() && child->isRenderBlock() && child->style()->styleType() == BEFORE ? static_cast<RenderBlock*>(child) : 0;
     55    return child && !child->isRubyRun() && child->isRenderBlock() && child->style()->styleType() == BEFORE ? toRenderBlock(child) : 0;
    5656}
    5757
     
    5959{
    6060    RenderObject* child = ruby->lastChild();
    61     return child && !child->isRubyRun() && child->isRenderBlock() && child->style()->styleType() == AFTER ? static_cast<RenderBlock*>(child) : 0;
     61    return child && !child->isRubyRun() && child->isRenderBlock() && child->style()->styleType() == AFTER ? toRenderBlock(child) : 0;
    6262}
    6363
     
    7979        child = child->previousSibling();
    8080    ASSERT(!child || child->isRubyRun() || child->isBeforeContent() || child == rubyBeforeBlock(ruby));
    81     return child && child->isRubyRun() ? static_cast<RenderRubyRun*>(child) : 0;
     81    return child && child->isRubyRun() ? toRenderRubyRun(child) : 0;
    8282}
    8383
     
    8686    while (child && !child->isRubyRun())
    8787        child = child->parent();
    88     return static_cast<RenderRubyRun*>(child);
     88    return toRenderRubyRun(child);
    8989}
    9090
  • trunk/Source/WebCore/rendering/RenderRubyBase.cpp

    r79629 r89304  
    192192    ASSERT(parent()->isRubyRun());
    193193
    194     return static_cast<RenderRubyRun*>(parent());
     194    return toRenderRubyRun(parent());
    195195}
    196196
  • trunk/Source/WebCore/rendering/RenderRubyRun.cpp

    r82903 r89304  
    160160        if (base && rightNeighbour && rightNeighbour->isRubyRun()) {
    161161            // Ruby run without a base can happen only at the first run.
    162             RenderRubyRun* rightRun = static_cast<RenderRubyRun*>(rightNeighbour);
     162            RenderRubyRun* rightRun = toRenderRubyRun(rightNeighbour);
    163163            if (rightRun->hasRubyBase()) {
    164164                RenderRubyBase* rightBase = rightRun->rubyBaseSafe();
Note: See TracChangeset for help on using the changeset viewer.