Commit d885df72 authored by hyatt@apple.com's avatar hyatt@apple.com

WebCore:

2009-01-21  David Hyatt  <hyatt@apple.com>

        Fix for https://bugs.webkit.org/show_bug.cgi?id=23453

        Devirtualize the width/height/x/y methods of the render tree.  The methods are now non-virtual on RenderBox.
        Many functions that were previously in RenderObject.cpp are now in RenderBox.cpp.

        Reviewed by Eric Seidel and Darin Adler

        * WebCore.base.exp:
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::sizingBox):
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::getUpperLeftCorner):
        (WebCore::ContainerNode::getLowerRightCorner):
        * dom/Element.cpp:
        (WebCore::Element::offsetLeft):
        (WebCore::Element::offsetTop):
        (WebCore::Element::offsetWidth):
        (WebCore::Element::offsetHeight):
        (WebCore::Element::offsetParent):
        (WebCore::Element::clientLeft):
        (WebCore::Element::clientTop):
        (WebCore::Element::clientWidth):
        (WebCore::Element::clientHeight):
        (WebCore::Element::scrollLeft):
        (WebCore::Element::scrollTop):
        (WebCore::Element::setScrollLeft):
        (WebCore::Element::setScrollTop):
        (WebCore::Element::scrollWidth):
        (WebCore::Element::scrollHeight):
        * dom/Node.cpp:
        (WebCore::Node::renderBox):
        (WebCore::Node::getRect):
        * dom/Node.h:
        * dom/Position.cpp:
        (WebCore::endsOfNodeAreVisuallyDistinctPositions):
        (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
        (WebCore::Position::isCandidate):
        * dom/PositionIterator.cpp:
        (WebCore::PositionIterator::isCandidate):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
        * editing/DeleteButtonController.cpp:
        (WebCore::isDeletableElement):
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::removeNode):
        * editing/Editor.cpp:
        (WebCore::Editor::insideVisibleArea):
        * editing/EditorCommand.cpp:
        (WebCore::verticalScrollDistance):
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::isKeyboardFocusable):
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::willDraw):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::isFocusable):
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::width):
        (WebCore::HTMLFrameElementBase::height):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::width):
        (WebCore::HTMLImageElement::height):
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::drawNodeHighlight):
        * page/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
        * page/FrameView.cpp:
        (WebCore::FrameView::createScrollbar):
        (WebCore::FrameView::updateDashboardRegions):
        * page/animation/AnimationBase.cpp:
        (WebCore::blendFunc):
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::imageRect):
        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::renderBox):
        (WebCore::InlineBox::adjustPosition):
        * rendering/InlineBox.h:
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::placeBoxesHorizontally):
        (WebCore::InlineFlowBox::verticallyAlignBoxes):
        (WebCore::InlineFlowBox::placeBoxesVertically):
        * rendering/InlineFlowBox.h:
        * rendering/RenderApplet.cpp:
        (WebCore::RenderApplet::createWidgetIfNecessary):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::overflowHeight):
        (WebCore::RenderBlock::overflowWidth):
        (WebCore::RenderBlock::overflowRect):
        (WebCore::RenderBlock::isSelfCollapsingBlock):
        (WebCore::RenderBlock::layout):
        (WebCore::RenderBlock::layoutBlock):
        (WebCore::RenderBlock::adjustPositionedBlock):
        (WebCore::RenderBlock::adjustFloatingBlock):
        (WebCore::RenderBlock::handleSpecialChild):
        (WebCore::RenderBlock::handlePositionedChild):
        (WebCore::RenderBlock::handleFloatingChild):
        (WebCore::RenderBlock::handleCompactChild):
        (WebCore::RenderBlock::insertCompactIfNeeded):
        (WebCore::RenderBlock::handleRunInChild):
        (WebCore::RenderBlock::collapseMargins):
        (WebCore::RenderBlock::clearFloatsIfNeeded):
        (WebCore::RenderBlock::estimateVerticalPosition):
        (WebCore::RenderBlock::determineHorizontalPosition):
        (WebCore::RenderBlock::handleBottomOfBlock):
        (WebCore::RenderBlock::layoutBlockChildren):
        (WebCore::RenderBlock::layoutOnlyPositionedObjects):
        (WebCore::RenderBlock::layoutPositionedObjects):
        (WebCore::RenderBlock::markPositionedObjectsForLayout):
        (WebCore::RenderBlock::repaintOverhangingFloats):
        (WebCore::RenderBlock::paint):
        (WebCore::RenderBlock::paintChildren):
        (WebCore::RenderBlock::paintObject):
        (WebCore::RenderBlock::paintFloats):
        (WebCore::RenderBlock::paintContinuationOutlines):
        (WebCore::clipOutPositionedObjects):
        (WebCore::RenderBlock::fillSelectionGaps):
        (WebCore::RenderBlock::fillBlockSelectionGaps):
        (WebCore::RenderBlock::leftSelectionOffset):
        (WebCore::RenderBlock::rightSelectionOffset):
        (WebCore::RenderBlock::insertPositionedObject):
        (WebCore::RenderBlock::removePositionedObject):
        (WebCore::RenderBlock::removePositionedObjects):
        (WebCore::RenderBlock::insertFloatingObject):
        (WebCore::RenderBlock::removeFloatingObject):
        (WebCore::RenderBlock::positionNewFloats):
        (WebCore::RenderBlock::newLine):
        (WebCore::RenderBlock::lowestPosition):
        (WebCore::RenderBlock::rightmostPosition):
        (WebCore::RenderBlock::leftmostPosition):
        (WebCore::RenderBlock::clearFloats):
        (WebCore::RenderBlock::addOverhangingFloats):
        (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout):
        (WebCore::RenderBlock::getClearDelta):
        (WebCore::RenderBlock::nodeAtPoint):
        (WebCore::RenderBlock::positionForCoordinates):
        (WebCore::RenderBlock::layoutColumns):
        (WebCore::RenderBlock::getBaselineOfFirstLineBox):
        (WebCore::RenderBlock::getBaselineOfLastLineBox):
        (WebCore::getHeightForLineCount):
        (WebCore::RenderBlock::adjustForBorderFit):
        * rendering/RenderBlock.h:
        (WebCore::RenderBlock::FloatWithRect::FloatWithRect):
        (WebCore::RenderBlock::hasOverhangingFloats):
        (WebCore::RenderBlock::CompactInfo::compact):
        (WebCore::RenderBlock::CompactInfo::set):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::RenderBox):
        (WebCore::RenderBox::offsetLeft):
        (WebCore::RenderBox::offsetTop):
        (WebCore::RenderBox::offsetParent):
        (WebCore::RenderBox::clientWidth):
        (WebCore::RenderBox::clientHeight):
        (WebCore::RenderBox::scrollWidth):
        (WebCore::RenderBox::scrollHeight):
        (WebCore::RenderBox::scrollLeft):
        (WebCore::RenderBox::scrollTop):
        (WebCore::RenderBox::setScrollLeft):
        (WebCore::RenderBox::setScrollTop):
        (WebCore::RenderBox::absoluteRects):
        (WebCore::RenderBox::absoluteQuads):
        (WebCore::RenderBox::absoluteContentBox):
        (WebCore::RenderBox::absoluteContentQuad):
        (WebCore::RenderBox::absoluteOutlineBounds):
        (WebCore::RenderBox::addFocusRingRects):
        (WebCore::RenderBox::reflectionBox):
        (WebCore::RenderBox::reflectionOffset):
        (WebCore::RenderBox::reflectedRect):
        (WebCore::RenderBox::overrideWidth):
        (WebCore::RenderBox::overrideHeight):
        (WebCore::RenderBox::nodeAtPoint):
        (WebCore::RenderBox::paint):
        (WebCore::RenderBox::maskClipRect):
        (WebCore::RenderBox::repaintLayerRectsForImage):
        (WebCore::RenderBox::paintCustomHighlight):
        (WebCore::RenderBox::getOverflowClipRect):
        (WebCore::RenderBox::getClipRect):
        (WebCore::RenderBox::containingBlockWidth):
        (WebCore::RenderBox::localToAbsolute):
        (WebCore::RenderBox::offsetFromContainer):
        (WebCore::RenderBox::position):
        (WebCore::RenderBox::computeAbsoluteRepaintRect):
        (WebCore::RenderBox::repaintDuringLayoutIfMoved):
        (WebCore::RenderBox::calcWidth):
        (WebCore::RenderBox::calcWidthUsing):
        (WebCore::RenderBox::calcHorizontalMargins):
        (WebCore::RenderBox::calcHeight):
        (WebCore::RenderBox::calcPercentageHeight):
        (WebCore::RenderBox::calcReplacedHeightUsing):
        (WebCore::RenderBox::containingBlockWidthForPositioned):
        (WebCore::RenderBox::containingBlockHeightForPositioned):
        (WebCore::RenderBox::calcAbsoluteHorizontal):
        (WebCore::RenderBox::calcAbsoluteVertical):
        (WebCore::RenderBox::calcAbsoluteVerticalValues):
        (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
        (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
        (WebCore::RenderBox::localCaretRect):
        (WebCore::RenderBox::lowestPosition):
        (WebCore::RenderBox::rightmostPosition):
        (WebCore::RenderBox::leftmostPosition):
        (WebCore::RenderBox::localTransform):
        * rendering/RenderBox.h:
        (WebCore::):
        (WebCore::RenderBox::x):
        (WebCore::RenderBox::y):
        (WebCore::RenderBox::width):
        (WebCore::RenderBox::height):
        (WebCore::RenderBox::setX):
        (WebCore::RenderBox::setY):
        (WebCore::RenderBox::setWidth):
        (WebCore::RenderBox::setHeight):
        (WebCore::RenderBox::location):
        (WebCore::RenderBox::size):
        (WebCore::RenderBox::setLocation):
        (WebCore::RenderBox::setSize):
        (WebCore::RenderBox::move):
        (WebCore::RenderBox::frameRect):
        (WebCore::RenderBox::setFrameRect):
        (WebCore::RenderBox::borderBoxRect):
        (WebCore::RenderBox::contentBoxRect):
        (WebCore::RenderBox::previousSiblingBox):
        (WebCore::RenderBox::nextSiblingBox):
        (WebCore::RenderBox::parentBox):
        (WebCore::RenderBox::overflowHeight):
        (WebCore::RenderBox::overflowWidth):
        (WebCore::RenderBox::setOverflowHeight):
        (WebCore::RenderBox::setOverflowWidth):
        (WebCore::RenderBox::overflowLeft):
        (WebCore::RenderBox::overflowTop):
        (WebCore::RenderBox::overflowRect):
        (WebCore::RenderBox::contentWidth):
        (WebCore::RenderBox::contentHeight):
        (WebCore::RenderBox::offsetWidth):
        (WebCore::RenderBox::offsetHeight):
        (WebCore::RenderBox::clientLeft):
        (WebCore::RenderBox::clientTop):
        (WebCore::RenderBox::availableWidth):
        (WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly):
        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::controlClipRect):
        * rendering/RenderContainer.cpp:
        (WebCore::RenderContainer::layout):
        (WebCore::RenderContainer::positionForCoordinates):
        * rendering/RenderContainer.h:
        (WebCore::RenderContainer::firstChildBox):
        (WebCore::RenderContainer::lastChildBox):
        * rendering/RenderFieldset.cpp:
        (WebCore::RenderFieldset::calcPrefWidths):
        (WebCore::RenderFieldset::layoutLegend):
        (WebCore::RenderFieldset::findLegend):
        (WebCore::RenderFieldset::paintBoxDecorations):
        (WebCore::RenderFieldset::paintMask):
        * rendering/RenderFieldset.h:
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::maxFilenameWidth):
        (WebCore::RenderFileUploadControl::paintObject):
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::FlexBoxIterator::FlexBoxIterator):
        (WebCore::FlexBoxIterator::first):
        (WebCore::FlexBoxIterator::next):
        (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
        (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
        (WebCore::RenderFlexibleBox::layoutBlock):
        (WebCore::RenderFlexibleBox::layoutHorizontalBox):
        (WebCore::RenderFlexibleBox::layoutVerticalBox):
        (WebCore::RenderFlexibleBox::placeChild):
        (WebCore::RenderFlexibleBox::allowedChildFlex):
        * rendering/RenderFlexibleBox.h:
        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::absoluteClippedOverflowRect):
        (WebCore::RenderFlow::lowestPosition):
        (WebCore::RenderFlow::rightmostPosition):
        (WebCore::RenderFlow::leftmostPosition):
        (WebCore::RenderFlow::localCaretRect):
        (WebCore::RenderFlow::addFocusRingRects):
        * rendering/RenderFrameSet.cpp:
        (WebCore::RenderFrameSet::paint):
        (WebCore::RenderFrameSet::layout):
        (WebCore::RenderFrameSet::positionFrames):
        * rendering/RenderHTMLCanvas.cpp:
        (WebCore::RenderHTMLCanvas::paintReplaced):
        (WebCore::RenderHTMLCanvas::canvasSizeChanged):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::imageChanged):
        (WebCore::RenderImage::paintReplaced):
        (WebCore::RenderImage::nodeAtPoint):
        (WebCore::RenderImage::calcReplacedWidth):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::absoluteRects):
        (WebCore::RenderInline::boundingBoxWidth):
        (WebCore::RenderInline::boundingBoxHeight):
        (WebCore::RenderInline::positionForCoordinates):
        * rendering/RenderInline.h:
        (WebCore::RenderInline::offsetWidth):
        (WebCore::RenderInline::offsetHeight):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateTransform):
        (WebCore::RenderLayer::updateLayerPosition):
        (WebCore::RenderLayer::scrollbarCornerPresent):
        (WebCore::RenderLayer::createScrollbar):
        (WebCore::RenderLayer::positionOverflowControls):
        (WebCore::RenderLayer::paintScrollCorner):
        (WebCore::RenderLayer::paintResizer):
        (WebCore::RenderLayer::paintLayer):
        (WebCore::RenderLayer::hitTestLayer):
        (WebCore::RenderLayer::calculateRects):
        (WebCore::RenderLayer::boundingBox):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::calcHeight):
        (WebCore::RenderListBox::controlClipRect):
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::positionListMarker):
        (WebCore::RenderListItem::paint):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::paint):
        (WebCore::RenderListMarker::layout):
        (WebCore::RenderListMarker::imageChanged):
        (WebCore::RenderListMarker::getRelativeMarkerRect):
        (WebCore::RenderListMarker::selectionRect):
        * rendering/RenderMarquee.cpp:
        (WebCore::RenderMarquee::computePosition):
        * rendering/RenderMedia.cpp:
        (WebCore::RenderMedia::layout):
        (WebCore::RenderMedia::lowestPosition):
        (WebCore::RenderMedia::rightmostPosition):
        (WebCore::RenderMedia::leftmostPosition):
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::controlClipRect):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::RenderObject):
        (WebCore::RenderObject::markAllDescendantsWithFloatsForLayout):
        (WebCore::RenderObject::paintOutline):
        (WebCore::RenderObject::addLineBoxRects):
        (WebCore::RenderObject::absoluteBoundingBoxRect):
        (WebCore::RenderObject::addAbsoluteRectForLayer):
        (WebCore::RenderObject::paintingRootRect):
        (WebCore::RenderObject::container):
        (WebCore::RenderObject::removeFromObjectLists):
        (WebCore::RenderObject::updateHitTestResult):
        (WebCore::RenderObject::addDashboardRegions):
        (WebCore::RenderObject::localTransform):
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isBox):
        (WebCore::RenderObject::hasMask):
        (WebCore::RenderObject::setIsText):
        (WebCore::RenderObject::setIsBox):
        (WebCore::RenderObject::borderTop):
        (WebCore::RenderObject::borderBottom):
        (WebCore::RenderObject::absoluteRects):
        (WebCore::RenderObject::collectAbsoluteLineBoxQuads):
        (WebCore::RenderObject::absoluteQuads):
        (WebCore::RenderObject::hasReflection):
        (WebCore::RenderObject::addFocusRingRects):
        (WebCore::RenderObject::absoluteOutlineBounds):
        * rendering/RenderPart.cpp:
        (WebCore::RenderPart::updateWidgetPosition):
        * rendering/RenderPath.cpp:
        (WebCore::RenderPath::layout):
        (WebCore::RenderPath::paint):
        (WebCore::RenderPath::absoluteOutlineBounds):
        * rendering/RenderPath.h:
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::layout):
        (WebCore::RenderReplaced::paint):
        (WebCore::RenderReplaced::shouldPaint):
        (WebCore::RenderReplaced::positionForCoordinates):
        (WebCore::RenderReplaced::localSelectionRect):
        (WebCore::RenderReplaced::adjustOverflowForBoxShadow):
        (WebCore::RenderReplaced::overflowRect):
        * rendering/RenderReplica.cpp:
        (WebCore::RenderReplica::layout):
        (WebCore::RenderReplica::calcPrefWidths):
        (WebCore::RenderReplica::paint):
        * rendering/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::paint):
        (WebCore::RenderSVGContainer::absoluteOutlineBounds):
        * rendering/RenderSVGContainer.h:
        (WebCore::RenderSVGContainer::width):
        (WebCore::RenderSVGContainer::height):
        * rendering/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::layout):
        * rendering/RenderSVGInlineText.cpp:
        (WebCore::RenderSVGInlineText::computeAbsoluteRectForRange):
        (WebCore::RenderSVGInlineText::positionForCoordinates):
        * rendering/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::layout):
        (WebCore::RenderSVGRoot::applyContentTransforms):
        (WebCore::RenderSVGRoot::paint):
        (WebCore::RenderSVGRoot::absoluteTransform):
        (WebCore::RenderSVGRoot::nodeAtPoint):
        * rendering/RenderSVGTSpan.cpp:
        (WebCore::RenderSVGTSpan::absoluteRects):
        (WebCore::RenderSVGTSpan::absoluteQuads):
        * rendering/RenderSVGText.cpp:
        (WebCore::RenderSVGText::layout):
        (WebCore::RenderSVGText::relativeBBox):
        * rendering/RenderSVGTextPath.cpp:
        (WebCore::RenderSVGTextPath::absoluteRects):
        (WebCore::RenderSVGTextPath::absoluteQuads):
        * rendering/RenderSVGViewportContainer.cpp:
        (WebCore::RenderSVGViewportContainer::nodeAtPoint):
        * rendering/RenderScrollbar.cpp:
        (WebCore::RenderScrollbar::createCustomScrollbar):
        (WebCore::RenderScrollbar::RenderScrollbar):
        (WebCore::RenderScrollbar::setParent):
        * rendering/RenderScrollbar.h:
        (WebCore::RenderScrollbar::owningRenderer):
        * rendering/RenderScrollbarPart.cpp:
        (WebCore::RenderScrollbarPart::layout):
        (WebCore::RenderScrollbarPart::layoutHorizontalPart):
        (WebCore::RenderScrollbarPart::layoutVerticalPart):
        (WebCore::RenderScrollbarPart::computeScrollbarWidth):
        (WebCore::RenderScrollbarPart::computeScrollbarHeight):
        (WebCore::RenderScrollbarPart::paintIntoRect):
        * rendering/RenderSlider.cpp:
        (WebCore::HTMLSliderThumbElement::defaultEventHandler):
        (WebCore::RenderSlider::layout):
        (WebCore::RenderSlider::mouseEventIsInThumb):
        (WebCore::RenderSlider::positionForOffset):
        (WebCore::RenderSlider::trackSize):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::calcWidth):
        (WebCore::RenderTable::layout):
        (WebCore::RenderTable::paint):
        (WebCore::RenderTable::getBaselineOfFirstLineBox):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::updateWidth):
        (WebCore::RenderTableCell::computeAbsoluteRepaintRect):
        (WebCore::RenderTableCell::localToAbsolute):
        (WebCore::RenderTableCell::absoluteToLocal):
        (WebCore::RenderTableCell::localToAbsoluteQuad):
        (WebCore::RenderTableCell::paint):
        (WebCore::RenderTableCell::paintBackgroundsBehindCell):
        * rendering/RenderTableCell.h:
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild):
        (WebCore::RenderTableSection::addCell):
        (WebCore::RenderTableSection::setCellWidths):
        (WebCore::RenderTableSection::calcRowHeight):
        (WebCore::RenderTableSection::layoutRows):
        (WebCore::RenderTableSection::lowestPosition):
        (WebCore::RenderTableSection::rightmostPosition):
        (WebCore::RenderTableSection::leftmostPosition):
        (WebCore::RenderTableSection::getBaselineOfFirstLineBox):
        (WebCore::RenderTableSection::paint):
        (WebCore::RenderTableSection::recalcCells):
        (WebCore::RenderTableSection::nodeAtPoint):
        * rendering/RenderTableSection.h:
        (WebCore::RenderTableSection::overflowWidth):
        (WebCore::RenderTableSection::overflowHeight):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::RenderText):
        (WebCore::RenderText::boundingBoxX):
        (WebCore::RenderText::boundingBoxY):
        (WebCore::RenderText::firstRunX):
        (WebCore::RenderText::firstRunY):
        (WebCore::RenderText::boundingBoxHeight):
        (WebCore::RenderText::boundingBoxWidth):
        * rendering/RenderText.h:
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::textBlockHeight):
        (WebCore::RenderTextControl::textBlockWidth):
        (WebCore::RenderTextControl::setSelectionRange):
        (WebCore::RenderTextControl::calcHeight):
        (WebCore::RenderTextControl::hitInnerTextBlock):
        (WebCore::RenderTextControl::controlClipRect):
        * rendering/RenderTextControlMultiLine.cpp:
        (WebCore::RenderTextControlMultiLine::layout):
        (WebCore::RenderTextControlMultiLine::adjustControlHeightBasedOnLineHeight):
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::paint):
        (WebCore::RenderTextControlSingleLine::layout):
        (WebCore::RenderTextControlSingleLine::nodeAtPoint):
        (WebCore::RenderTextControlSingleLine::forwardEvent):
        (WebCore::RenderTextControlSingleLine::textBlockWidth):
        (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
        (WebCore::RenderTextControlSingleLine::clientPaddingLeft):
        (WebCore::RenderTextControlSingleLine::clientPaddingRight):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::hitTestMediaControlPart):
        (WebCore::RenderTheme::baselinePosition):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
        (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
        (WebCore::RenderThemeMac::hitTestMediaControlPart):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::operator<<):
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::videoBox):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::RenderView):
        (WebCore::RenderView::calcHeight):
        (WebCore::RenderView::calcWidth):
        (WebCore::RenderView::layout):
        (WebCore::RenderView::viewRect):
        (WebCore::RenderView::docHeight):
        (WebCore::RenderView::docWidth):
        (WebCore::RenderView::setBestTruncatedAt):
        * rendering/RenderView.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paint):
        (WebCore::RenderWidget::updateWidgetPosition):
        (WebCore::RenderWidget::nodeAtPoint):
        * rendering/RootInlineBox.h:
        (WebCore::RootInlineBox::floats):
        (WebCore::RootInlineBox::floatsPtr):
        * rendering/SVGInlineFlowBox.cpp:
        (WebCore::SVGInlineFlowBox::verticallyAlignBoxes):
        * rendering/SVGInlineFlowBox.h:
        * rendering/SVGRenderTreeAsText.cpp:
        (WebCore::operator<<):
        (WebCore::write):
        * rendering/SVGRootInlineBox.cpp:
        (WebCore::SVGRootInlineBox::verticallyAlignBoxes):
        (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
        (WebCore::SVGRootInlineBox::layoutInlineBoxes):
        * rendering/SVGRootInlineBox.h:
        * rendering/bidi.cpp:
        (WebCore::RenderBlock::computeHorizontalPositionsForLine):
        (WebCore::RenderBlock::computeVerticalPositionsForLine):
        (WebCore::RenderBlock::layoutInlineChildren):
        (WebCore::RenderBlock::determineStartPosition):
        (WebCore::RenderBlock::matchedEndLine):
        (WebCore::RenderBlock::skipTrailingWhitespace):
        (WebCore::RenderBlock::skipLeadingWhitespace):
        (WebCore::RenderBlock::fitBelowFloats):
        (WebCore::RenderBlock::findNextLineBreak):
        (WebCore::RenderBlock::checkLinesForOverflow):
        * svg/SVGLength.cpp:
        (WebCore::SVGLength::PercentageOfViewport):

WebKit/mac:

2009-01-21  David Hyatt  <hyatt@apple.com>

        Devirtualize width/height/x/y on RenderObject and move the methods to RenderBox.

        Reviewed by Eric Seidel and Darin Adler

        * WebView/WebRenderNode.mm:
        (copyRenderNode):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2d8d7f83
This diff is collapsed.
......@@ -734,6 +734,10 @@ __ZNK7WebCore12IconDatabase12databasePathEv
__ZNK7WebCore12IconDatabase24shouldStopThreadActivityEv
__ZNK7WebCore12IconDatabase9isEnabledEv
__ZNK7WebCore12RenderObject14enclosingLayerEv
__ZNK7WebCore10RenderText16boundingBoxWidthEv
__ZNK7WebCore10RenderText17boundingBoxHeightEv
__ZNK7WebCore10RenderText9firstRunXEv
__ZNK7WebCore10RenderText9firstRunYEv
__ZNK7WebCore12SharedBuffer4dataEv
__ZNK7WebCore12SharedBuffer4sizeEv
__ZNK7WebCore12TextEncoding6decodeEPKcmbRb
......
......@@ -36,7 +36,7 @@
#include "ExceptionCode.h"
#include "Pair.h"
#include "Rect.h"
#include "RenderObject.h"
#include "RenderBox.h"
#include "ShadowValue.h"
#include "WebKitCSSTransformValue.h"
......@@ -395,7 +395,11 @@ static PassRefPtr<CSSValue> getBorderRadiusCornerValue(IntSize radius)
static IntRect sizingBox(RenderObject* renderer)
{
return renderer->style()->boxSizing() == CONTENT_BOX ? renderer->contentBox() : renderer->borderBox();
if (!renderer->isBox())
return IntRect();
RenderBox* box = RenderBox::toRenderBox(renderer);
return box->style()->boxSizing() == CONTENT_BOX ? box->contentBoxRect() : box->borderBoxRect();
}
static PassRefPtr<CSSValue> computedTransform(RenderObject* renderer)
......
......@@ -34,6 +34,7 @@
#include "FrameView.h"
#include "InlineTextBox.h"
#include "MutationEvent.h"
#include "RenderBox.h"
#include "RenderTheme.h"
#include "RootInlineBox.h"
#include <wtf/CurrentTime.h>
......@@ -691,10 +692,12 @@ bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
} else if ((o->isText() && !o->isBR()) || o->isReplaced()) {
point = o->container()->localToAbsolute();
if (o->isText() && static_cast<RenderText *>(o)->firstTextBox()) {
point.move(static_cast<RenderText *>(o)->minXPos(),
point.move(static_cast<RenderText *>(o)->boundingBoxX(),
static_cast<RenderText *>(o)->firstTextBox()->root()->topOverflow());
} else
point.move(o->xPos(), o->yPos());
} else if (o->isBox()) {
RenderBox* box = RenderBox::toRenderBox(o);
point.move(box->x(), box->y());
}
return true;
}
}
......@@ -717,9 +720,10 @@ bool ContainerNode::getLowerRightCorner(FloatPoint& point) const
RenderObject *o = renderer();
if (!o->isInline() || o->isReplaced())
{
RenderBox* box = RenderBox::toRenderBox(o);
point = o->localToAbsolute();
point.move(o->width(),
o->height() + o->borderTopExtra() + o->borderBottomExtra());
point.move(box->width(),
box->height() + box->borderTopExtra() + box->borderBottomExtra());
return true;
}
......@@ -741,13 +745,13 @@ bool ContainerNode::getLowerRightCorner(FloatPoint& point) const
}
if (o->isText() || o->isReplaced()) {
point = o->container()->localToAbsolute();
int xOffset;
if (o->isText())
xOffset = static_cast<RenderText *>(o)->minXPos() + o->width();
else
xOffset = o->xPos() + o->width();
point.move(xOffset, o->yPos() + o->height());
if (o->isText()) {
RenderText* text = static_cast<RenderText*>(o);
point.move(text->boundingBoxX() + text->boundingBoxWidth(), text->boundingBoxHeight());
} else {
RenderBox* box = RenderBox::toRenderBox(o);
point.move(box->x() + box->width(), box->y() + box->height());
}
return true;
}
}
......
......@@ -274,7 +274,7 @@ static int adjustForAbsoluteZoom(int value, RenderObject* renderer)
int Element::offsetLeft()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForLocalZoom(rend->offsetLeft(), rend);
return 0;
}
......@@ -282,7 +282,7 @@ int Element::offsetLeft()
int Element::offsetTop()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForLocalZoom(rend->offsetTop(), rend);
return 0;
}
......@@ -290,7 +290,7 @@ int Element::offsetTop()
int Element::offsetWidth()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->offsetWidth(), rend);
return 0;
}
......@@ -298,7 +298,7 @@ int Element::offsetWidth()
int Element::offsetHeight()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->offsetHeight(), rend);
return 0;
}
......@@ -306,7 +306,7 @@ int Element::offsetHeight()
Element* Element::offsetParent()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
if (RenderObject* offsetParent = rend->offsetParent())
return static_cast<Element*>(offsetParent->element());
return 0;
......@@ -316,7 +316,7 @@ int Element::clientLeft()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->clientLeft(), rend);
return 0;
}
......@@ -325,7 +325,7 @@ int Element::clientTop()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->clientTop(), rend);
return 0;
}
......@@ -344,7 +344,7 @@ int Element::clientWidth()
}
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->clientWidth(), rend);
return 0;
}
......@@ -363,7 +363,7 @@ int Element::clientHeight()
return view->layoutHeight();
}
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->clientHeight(), rend);
return 0;
}
......@@ -371,7 +371,7 @@ int Element::clientHeight()
int Element::scrollLeft()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->scrollLeft(), rend);
return 0;
}
......@@ -379,7 +379,7 @@ int Element::scrollLeft()
int Element::scrollTop()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->scrollTop(), rend);
return 0;
}
......@@ -387,21 +387,21 @@ int Element::scrollTop()
void Element::setScrollLeft(int newLeft)
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
rend->setScrollLeft(static_cast<int>(newLeft * rend->style()->effectiveZoom()));
}
void Element::setScrollTop(int newTop)
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
rend->setScrollTop(static_cast<int>(newTop * rend->style()->effectiveZoom()));
}
int Element::scrollWidth()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->scrollWidth(), rend);
return 0;
}
......@@ -409,7 +409,7 @@ int Element::scrollWidth()
int Element::scrollHeight()
{
document()->updateLayoutIgnorePendingStylesheets();
if (RenderObject* rend = renderer())
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->scrollHeight(), rend);
return 0;
}
......
......@@ -576,14 +576,16 @@ bool Node::shouldUseInputMethod() const
return isContentEditable();
}
RenderBox* Node::renderBox() const
{
return m_renderer && m_renderer->isBox() ? static_cast<const RenderBox* const>(m_renderer) : 0;
}
IntRect Node::getRect() const
{
// FIXME: broken with transforms
if (renderer()) {
FloatPoint absPos = renderer()->localToAbsolute();
return IntRect(roundedIntPoint(absPos),
IntSize(renderer()->width(), renderer()->height() + renderer()->borderTopExtra() + renderer()->borderBottomExtra()));
}
if (renderer())
return renderer()->absoluteBoundingBoxRect();
return IntRect();
}
......
......@@ -52,6 +52,7 @@ class PlatformMouseEvent;
class PlatformWheelEvent;
class QualifiedName;
class RenderArena;
class RenderBox;
class RenderObject;
class RenderStyle;
class StringBuilder;
......@@ -374,6 +375,10 @@ public:
RenderObject* previousRenderer();
void setRenderer(RenderObject* renderer) { m_renderer = renderer; }
// Use with caution. Does no type checking. Mostly a convenience method for shadow nodes of form controls, where we know exactly
// what kind of renderer we made.
RenderBox* renderBox() const;
void checkSetPrefix(const AtomicString& prefix, ExceptionCode&);
bool isDescendantOf(const Node*) const;
bool contains(const Node*) const;
......
......@@ -284,7 +284,7 @@ static bool endsOfNodeAreVisuallyDistinctPositions(Node* node)
return false;
// There is a VisiblePosition inside an empty inline-block container.
return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && node->renderer()->height() != 0 && !node->firstChild();
return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && RenderBox::toRenderBox(node->renderer())->height() != 0 && !node->firstChild();
}
static Node* enclosingVisualBoundary(Node* node)
......@@ -536,9 +536,11 @@ bool Position::hasRenderedNonAnonymousDescendantsWithHeight(RenderObject* render
{
RenderObject* stop = renderer->nextInPreOrderAfterChildren();
for (RenderObject *o = renderer->firstChild(); o && o != stop; o = o->nextInPreOrder())
if (o->element() && o->height())
return true;
if (o->element()) {
if ((o->isText() && static_cast<RenderText*>(o)->boundingBoxHeight()) ||
(o->isBox() && RenderBox::toRenderBox(o)->height()))
return true;
}
return false;
}
......@@ -569,7 +571,7 @@ bool Position::isCandidate() const
return (offset() == 0 || offset() == maxDeepOffset(node())) && !nodeIsUserSelectNone(node()->parent());
if (!node()->hasTagName(htmlTag) && renderer->isBlockFlow() && !hasRenderedNonAnonymousDescendantsWithHeight(renderer) &&
(renderer->height() || node()->hasTagName(bodyTag)))
(RenderBox::toRenderBox(renderer)->height() || node()->hasTagName(bodyTag)))
return offset() == 0 && !nodeIsUserSelectNone(node());
return false;
......
......@@ -27,7 +27,7 @@
#include "PositionIterator.h"
#include "Node.h"
#include "RenderObject.h"
#include "RenderBlock.h"
#include "htmlediting.h"
namespace WebCore {
......@@ -151,7 +151,7 @@ bool PositionIterator::isCandidate() const
return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelectNone(m_parent->parent());
if (!m_parent->hasTagName(htmlTag) && renderer->isBlockFlow() && !Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer) &&
(renderer->height() || m_parent->hasTagName(bodyTag)))
(static_cast<RenderBlock*>(renderer)->height() || m_parent->hasTagName(bodyTag)))
return atStartOfNode() && !Position::nodeIsUserSelectNone(m_parent);
return false;
......
......@@ -51,6 +51,7 @@
#include "RemoveNodeCommand.h"
#include "RemoveNodePreservingChildrenCommand.h"
#include "ReplaceSelectionCommand.h"
#include "RenderBlock.h"
#include "SetNodeAttributeCommand.h"
#include "SplitElementCommand.h"
#include "SplitTextNodeCommand.h"
......@@ -590,7 +591,8 @@ PassRefPtr<Node> CompositeEditCommand::addBlockPlaceholderIfNeeded(Element* cont
// append the placeholder to make sure it follows
// any unrendered blocks
if (renderer->height() == 0 || (renderer->isListItem() && renderer->isEmpty()))
RenderBlock* block = static_cast<RenderBlock*>(renderer);
if (block->height() == 0 || (block->isListItem() && block->isEmpty()))
return appendBlockPlaceholder(container);
return 0;
......
......@@ -42,7 +42,7 @@
#include "Node.h"
#include "Range.h"
#include "RemoveNodeCommand.h"
#include "RenderObject.h"
#include "RenderBox.h"
#include "SelectionController.h"
namespace WebCore {
......@@ -71,7 +71,11 @@ static bool isDeletableElement(const Node* node)
const unsigned minimumVisibleBorders = 3;
RenderObject* renderer = node->renderer();
if (!renderer || renderer->width() < minimumWidth || renderer->height() < minimumHeight)
if (!renderer || !renderer->isBox())
return false;
RenderBox* box = RenderBox::toRenderBox(renderer);
if (box->width() < minimumWidth || box->height() < minimumHeight)
return false;
if (renderer->isTable())
......
......@@ -38,6 +38,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "markup.h"
#include "RenderTableCell.h"
#include "ReplaceSelectionCommand.h"
#include "Text.h"
#include "TextIterator.h"
......@@ -357,7 +358,7 @@ void DeleteSelectionCommand::removeNode(PassRefPtr<Node> node)
// make sure empty cell has some height
updateLayout();
RenderObject *r = node->renderer();
if (r && r->isTableCell() && r->contentHeight() <= 0)
if (r && r->isTableCell() && static_cast<RenderTableCell*>(r)->contentHeight() <= 0)
insertBlockPlaceholder(Position(node,0));
return;
}
......
......@@ -2071,7 +2071,7 @@ bool Editor::insideVisibleArea(const IntPoint& point) const
return true;
IntRect rectInPageCoords = container->getOverflowClipRect(0, 0);
IntRect rectInFrameCoords = IntRect(renderer->xPos() * -1, renderer->yPos() * -1,
IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1,
rectInPageCoords.width(), rectInPageCoords.height());
return rectInFrameCoords.contains(point);
......@@ -2097,7 +2097,7 @@ bool Editor::insideVisibleArea(Range* range) const
return true;
IntRect rectInPageCoords = container->getOverflowClipRect(0, 0);
IntRect rectInFrameCoords = IntRect(renderer->xPos() * -1, renderer->yPos() * -1,
IntRect rectInFrameCoords = IntRect(renderer->x() * -1, renderer->y() * -1,
rectInPageCoords.width(), rectInPageCoords.height());
IntRect resultRect = range->boundingBox();
......
......@@ -225,14 +225,14 @@ static int verticalScrollDistance(Frame* frame)
if (!focusedNode)
return 0;
RenderObject* renderer = focusedNode->renderer();
if (!renderer)
if (!renderer || !renderer->isBox())
return 0;
RenderStyle* style = renderer->style();
if (!style)
return 0;
if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || renderer->isTextArea()))
return 0;
int height = renderer->clientHeight();
int height = RenderBox::toRenderBox(renderer)->clientHeight();
return max((height + 1) / 2, height - cAmountToKeepWhenPaging);
}
......
......@@ -107,13 +107,16 @@ bool HTMLAnchorElement::isKeyboardFocusable(KeyboardEvent* event) const
if (!document()->frame()->eventHandler()->tabsToLinks(event))
return false;
if (!renderer())
if (!renderer() || !renderer()->isBox())
return false;
// Before calling absoluteRects, check for the common case where the renderer
// or one of the continuations is non-empty, since this is a faster check and
// almost always returns true.
for (RenderObject* r = renderer(); r; r = r->virtualContinuation())
RenderBox* box = RenderBox::toRenderBox(renderer());
if (box->width() > 0 && box->height() > 0)
return true;
for (RenderFlow* r = box->virtualContinuation(); r; r = r->continuation())
if (r->width() > 0 && r->height() > 0)
return true;
......
......@@ -155,8 +155,8 @@ void HTMLCanvasElement::willDraw(const FloatRect& rect)
{
m_imageBuffer->clearImage();
if (RenderObject* ro = renderer()) {
FloatRect destRect = ro->contentBox();
if (RenderBox* ro = renderBox()) {
FloatRect destRect = ro->contentBoxRect();
FloatRect r = mapRect(rect, FloatRect(0, 0, m_size.width(), m_size.height()), destRect);
r.intersect(destRect);
if (m_dirtyRect.contains(r))
......
......@@ -199,7 +199,7 @@ bool HTMLFormControlElement::isFocusable() const
{
if (disabled() || !renderer() ||
(renderer()->style() && renderer()->style()->visibility() != VISIBLE) ||
renderer()->width() == 0 || renderer()->height() == 0)
!renderer()->isBox() || RenderBox::toRenderBox(renderer())->size().isEmpty())
return false;
return true;
}
......
......@@ -311,7 +311,7 @@ int HTMLFrameElementBase::width() const
return 0;
document()->updateLayoutIgnorePendingStylesheets();
return renderer()->width();
return RenderBox::toRenderBox(renderer())->width();
}
int HTMLFrameElementBase::height() const
......@@ -320,7 +320,7 @@ int HTMLFrameElementBase::height() const
return 0;
document()->updateLayoutIgnorePendingStylesheets();
return renderer()->height();
return RenderBox::toRenderBox(renderer())->height();
}
} // namespace WebCore
......@@ -226,7 +226,7 @@ int HTMLImageElement::width(bool ignorePendingStylesheets) const
else
document()->updateLayout();
return renderer() ? renderer()->contentWidth() : 0;
return renderBox() ? renderBox()->contentWidth() : 0;
}
int HTMLImageElement::height(bool ignorePendingStylesheets) const
......@@ -250,7 +250,7 @@ int HTMLImageElement::height(bool ignorePendingStylesheets) const
else
document()->updateLayout();
return renderer() ? renderer()->contentHeight() : 0;
return renderBox() ? renderBox()->contentHeight() : 0;
}
int HTMLImageElement::naturalWidth() const
......
......@@ -2760,12 +2760,12 @@ void InspectorController::drawNodeHighlight(GraphicsContext& context) const
if (!m_highlightedNode)
return;
RenderObject* renderer = m_highlightedNode->renderer();
RenderBox* renderer = m_highlightedNode->renderBox();
Frame* containingFrame = m_highlightedNode->document()->frame();
if (!renderer || !containingFrame)
return;
IntRect contentBox = renderer->contentBox();
IntRect contentBox = renderer->contentBoxRect();
// FIXME: Should we add methods to RenderObject to obtain these rects?
IntRect paddingBox(contentBox.x() - renderer->paddingLeft(), contentBox.y() - renderer->paddingTop(),
......
......@@ -1177,12 +1177,12 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
}
// check for one-dimensional image
if (m_renderer->height() <= 1 || m_renderer->width() <= 1)
RenderImage* image = static_cast<RenderImage*>(m_renderer);
if (image->height() <= 1 || image->width() <= 1)
return true;
// check whether rendered image was stretched from one-dimensional file image
if (isNativeImage()) {
RenderImage* image = static_cast<RenderImage*>(m_renderer);
if (image->cachedImage()) {
IntSize imageSize = image->cachedImage()->imageSize(image->view()->zoomFactor());
return imageSize.height() <= 1 || imageSize.width() <= 1;
......
......@@ -288,12 +288,12 @@ PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientatio
// Try the <body> element first as a scrollbar source.
Element* body = doc->body();
if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR))
return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderer());
return RenderScrollbar::createCustomScrollbar(this, orientation, body->renderBox());
// If the <body> didn't have a custom style, then the root element might.
Element* docElement = doc->documentElement();
if (docElement && docElement->renderer() && docElement->renderer()->style()->hasPseudoStyle(RenderStyle::SCROLLBAR))
return RenderScrollbar::createCustomScrollbar(this, orientation, docElement->renderer());
return RenderScrollbar::createCustomScrollbar(this, orientation, docElement->renderBox());
// If we have an owning iframe/frame element, then it can set the custom scrollbar also.
RenderPart* frameRenderer = m_frame->ownerRenderer();
......@@ -460,7 +460,7 @@ void FrameView::layout(bool allowSubtree)
hMode = ScrollbarAlwaysOff;
} else if (body->hasTagName(bodyTag)) {
if (!m_firstLayout && m_size.height() != layoutHeight()
&& static_cast<RenderBox*>(body->renderer())->stretchesToViewHeight())
&& RenderBox::toRenderBox(body->renderer())->stretchesToViewHeight())
body->renderer()->setChildNeedsLayout(true);
// It's sufficient to just check the X overflow,
// since it's illegal to have visible in only one direction.
......@@ -1095,7 +1095,7 @@ void FrameView::updateDashboardRegions()
if (!document->hasDashboardRegions())
return;
Vector<DashboardRegionValue> newRegions;
document->renderer()->collectDashboardRegions(newRegions);
document->renderBox()->collectDashboardRegions(newRegions);
if (newRegions == document->dashboardRegions())
return;
document->setDashboardRegions(newRegions);
......
......@@ -134,7 +134,7 @@ static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra
}
} else {
// Convert the TransformOperations into matrices
IntSize size = anim->renderer()->borderBox().size();
IntSize size = anim->renderer()->isBox() ? RenderBox::toRenderBox(anim->renderer())->borderBoxRect().size() : IntSize();
TransformationMatrix fromT;
TransformationMatrix toT;
from.apply(size, fromT);
......
......@@ -224,7 +224,7 @@ IntRect HitTestResult::imageRect() const
{