Changeset 89304 in webkit
- Timestamp:
- Jun 20, 2011 4:14:23 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89303 r89304 1 2011-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 1 30 2011-06-20 Anders Carlsson <andersca@apple.com> 2 31 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r88526 r89304 647 647 hasAnnotationsAfter = true; 648 648 649 RenderRubyRun* rubyRun = static_cast<RenderRubyRun*>(curr->renderer());649 RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer()); 650 650 if (RenderRubyBase* rubyBase = rubyRun->rubyBase()) { 651 651 int bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : 0); … … 1309 1309 1310 1310 if (curr->renderer()->isReplaced() && curr->renderer()->isRubyRun()) { 1311 RenderRubyRun* rubyRun = static_cast<RenderRubyRun*>(curr->renderer());1311 RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer()); 1312 1312 RenderRubyText* rubyText = rubyRun->rubyText(); 1313 1313 if (!rubyText) -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r88613 r89304 453 453 return true; // Cannot get the ruby text. 454 454 455 RenderRubyText* rubyText = static_cast<RenderRubyRun*>(containingBlock->parent())->rubyText();455 RenderRubyText* rubyText = toRenderRubyRun(containingBlock->parent())->rubyText(); 456 456 457 457 // 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 2255 2255 if (isSVGText && current.m_pos > 0) { 2256 2256 // 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)) { 2258 2258 addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, current.m_pos - 1)); 2259 2259 addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, current.m_pos)); … … 2273 2273 2274 2274 if (collapseWhiteSpace && currentCharacterIsSpace && !ignoringSpaces) 2275 trailingObjects.setTrailingWhitespace( static_cast<RenderText*>(current.m_obj));2275 trailingObjects.setTrailingWhitespace(toRenderText(current.m_obj)); 2276 2276 else if (!current.m_obj->style()->collapseWhiteSpace() || !currentCharacterIsSpace) 2277 2277 trailingObjects.clear(); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r88982 r89304 1904 1904 if (scrollbar) { 1905 1905 if (scrollbar->isCustomScrollbar()) 1906 static_cast<RenderScrollbar*>(scrollbar.get())->clearOwningRenderer();1906 toRenderScrollbar(scrollbar.get())->clearOwningRenderer(); 1907 1907 else { 1908 1908 if (orientation == HorizontalScrollbar) -
trunk/Source/WebCore/rendering/RenderRuby.cpp
r83787 r89304 53 53 { 54 54 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; 56 56 } 57 57 … … 59 59 { 60 60 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; 62 62 } 63 63 … … 79 79 child = child->previousSibling(); 80 80 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; 82 82 } 83 83 … … 86 86 while (child && !child->isRubyRun()) 87 87 child = child->parent(); 88 return static_cast<RenderRubyRun*>(child);88 return toRenderRubyRun(child); 89 89 } 90 90 -
trunk/Source/WebCore/rendering/RenderRubyBase.cpp
r79629 r89304 192 192 ASSERT(parent()->isRubyRun()); 193 193 194 return static_cast<RenderRubyRun*>(parent());194 return toRenderRubyRun(parent()); 195 195 } 196 196 -
trunk/Source/WebCore/rendering/RenderRubyRun.cpp
r82903 r89304 160 160 if (base && rightNeighbour && rightNeighbour->isRubyRun()) { 161 161 // Ruby run without a base can happen only at the first run. 162 RenderRubyRun* rightRun = static_cast<RenderRubyRun*>(rightNeighbour);162 RenderRubyRun* rightRun = toRenderRubyRun(rightNeighbour); 163 163 if (rightRun->hasRubyBase()) { 164 164 RenderRubyBase* rightBase = rightRun->rubyBaseSafe();
Note: See TracChangeset
for help on using the changeset viewer.