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
diff --git a/WebCore/rendering/bidi.cpp b/WebCore/rendering/bidi.cpp
index 38cbdb0..14592aa 100644
--- a/WebCore/rendering/bidi.cpp
+++ b/WebCore/rendering/bidi.cpp
@@ -566,7 +566,7 @@
 void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd)
 {
     // First determine our total width.
-    int availableWidth = lineWidth(m_height);
+    int availableWidth = lineWidth(height());
     int totWidth = lineBox->getFlowSpacingWidth();
     bool needsWordSpacing = false;
     unsigned numSpaces = 0;
@@ -597,7 +597,7 @@
             r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, m_firstLine));
         } else if (!r->m_object->isInlineFlow()) {
             r->m_object->calcWidth();
-            r->m_box->setWidth(r->m_object->width());
+            r->m_box->setWidth(toRenderBox(r->m_object)->width());
             if (!r->m_compact)
                  totWidth += r->m_object->marginLeft() + r->m_object->marginRight();
         }
@@ -611,7 +611,7 @@
     // we now examine our text-align property in order to determine where to position the
     // objects horizontally.  The total width of the line can be increased if we end up
     // justifying text.
-    int x = leftOffset(m_height);
+    int x = leftOffset(height());
     switch(textAlign) {
         case LEFT:
         case WEBKIT_LEFT:
@@ -720,12 +720,12 @@
 
 void RenderBlock::computeVerticalPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun)
 {
-    lineBox->verticallyAlignBoxes(m_height);
-    lineBox->setBlockHeight(m_height);
+    setHeight(lineBox->verticallyAlignBoxes(height()));
+    lineBox->setBlockHeight(height());
 
     // See if the line spilled out.  If so set overflow height accordingly.
     int bottomOfLine = lineBox->bottomOverflow();
-    if (bottomOfLine > m_height && bottomOfLine > m_overflowHeight)
+    if (bottomOfLine > height() && bottomOfLine > m_overflowHeight)
         m_overflowHeight = bottomOfLine;
 
     // Now make sure we place replaced render objects correctly.
@@ -736,7 +736,7 @@
         // Align positioned boxes with the top of the line box.  This is
         // a reasonable approximation of an appropriate y position.
         if (r->m_object->isPositioned())
-            r->m_box->setYPos(m_height);
+            r->m_box->setYPos(height());
 
         // Position is used to properly position both replaced elements and
         // to update the static normal flow x/y of positioned elements.
@@ -800,7 +800,7 @@
     
     m_overflowHeight = 0;
         
-    m_height = borderTop() + paddingTop();
+    setHeight(borderTop() + paddingTop());
     int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
 
     // Figure out if we should clear out our line boxes.
@@ -830,6 +830,8 @@
         while (o) {
             o->invalidateVerticalPosition();
             if (o->isReplaced() || o->isFloating() || o->isPositioned()) {
+                RenderBox* box = toRenderBox(o);
+                
                 if (relayoutChildren || o->style()->width().isPercent() || o->style()->height().isPercent())
                     o->setChildNeedsLayout(true, false);
                     
@@ -838,10 +840,10 @@
                     o->setPrefWidthsDirty(true, false);
             
                 if (o->isPositioned())
-                    o->containingBlock()->insertPositionedObject(o);
+                    o->containingBlock()->insertPositionedObject(box);
                 else {
                     if (o->isFloating())
-                        floats.append(FloatWithRect(o));
+                        floats.append(FloatWithRect(box));
                     else if (fullLayout || o->needsLayout()) // Replaced elements
                         o->dirtyLineBoxes(fullLayout);
 
@@ -895,8 +897,8 @@
 
         if (startLine) {
             useRepaintBounds = true;
-            repaintTop = m_height;
-            repaintBottom = m_height;
+            repaintTop = height();
+            repaintBottom = height();
             RenderArena* arena = renderArena();
             RootInlineBox* box = startLine;
             while (box) {
@@ -929,7 +931,7 @@
         bool endLineMatched = false;
         bool checkForEndLineMatch = endLine;
         bool checkForFloatsFromLastLine = false;
-        int lastHeight = m_height;
+        int lastHeight = height();
 
         while (!end.atEnd()) {
             // FIXME: Is this check necessary before the first iteration or can it be moved to the end?
@@ -1072,7 +1074,7 @@
                 lastFloat = m_floatingObjects->last();
             }
 
-            lastHeight = m_height;
+            lastHeight = height();
             sNumMidpoints = 0;
             sCurrMidpoint = 0;
             resolver.setPosition(end);
@@ -1081,7 +1083,7 @@
         if (endLine) {
             if (endLineMatched) {
                 // Attach all the remaining lines, and then adjust their y-positions as needed.
-                int delta = m_height - endLineYPos;
+                int delta = height() - endLineYPos;
                 for (RootInlineBox* line = endLine; line; line = line->nextRootBox()) {
                     line->attachLine();
                     if (delta) {
@@ -1089,17 +1091,17 @@
                         repaintBottom = max(repaintBottom, line->bottomOverflow() + max(delta, 0));
                         line->adjustPosition(0, delta);
                     }
-                    if (Vector<RenderObject*>* cleanLineFloats = line->floatsPtr()) {
-                        Vector<RenderObject*>::iterator end = cleanLineFloats->end();
-                        for (Vector<RenderObject*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
-                            int floatTop = (*f)->yPos() - (*f)->marginTop();
+                    if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
+                        Vector<RenderBox*>::iterator end = cleanLineFloats->end();
+                        for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
+                            int floatTop = (*f)->y() - (*f)->marginTop();
                             insertFloatingObject(*f);
-                            m_height = floatTop + delta;
+                            setHeight(floatTop + delta);
                             positionNewFloats();
                         }
                     }
                 }
-                m_height = lastRootBox()->blockHeight();
+                setHeight(lastRootBox()->blockHeight());
             } else {
                 // Delete all the remaining lines.
                 InlineRunBox* line = endLine;
@@ -1135,16 +1137,16 @@
     sCurrMidpoint = 0;
 
     // Now add in the bottom border/padding.
-    m_height += toAdd;
+    setHeight(height() + toAdd);
 
     // Always make sure this is at least our height.
-    m_overflowHeight = max(m_height, m_overflowHeight);
+    m_overflowHeight = max(height(), m_overflowHeight);
 
     // See if any lines spill out of the block.  If so, we need to update our overflow width.
     checkLinesForOverflow();
 
     if (!firstLineBox() && hasLineIfEmpty())
-        m_height += lineHeight(true, true);
+        setHeight(height() + lineHeight(true, true));
 
     // See if we have any lines that spill out of our block.  If we do, then we will possibly need to
     // truncate text.
@@ -1161,10 +1163,10 @@
     if (!fullLayout) {
         size_t floatIndex = 0;
         for (curr = firstRootBox(); curr && !curr->isDirty(); curr = curr->nextRootBox()) {
-            if (Vector<RenderObject*>* cleanLineFloats = curr->floatsPtr()) {
-                Vector<RenderObject*>::iterator end = cleanLineFloats->end();
-                for (Vector<RenderObject*>::iterator o = cleanLineFloats->begin(); o != end; ++o) {
-                    RenderObject* f = *o;
+            if (Vector<RenderBox*>* cleanLineFloats = curr->floatsPtr()) {
+                Vector<RenderBox*>::iterator end = cleanLineFloats->end();
+                for (Vector<RenderBox*>::iterator o = cleanLineFloats->begin(); o != end; ++o) {
+                    RenderBox* f = *o;
                     IntSize newSize(f->width() + f->marginLeft() +f->marginRight(), f->height() + f->marginTop() + f->marginBottom());
                     ASSERT(floatIndex < floats.size());
                     if (floats[floatIndex].object != f) {
@@ -1226,15 +1228,15 @@
 
     numCleanFloats = 0;
     if (!floats.isEmpty()) {
-        int savedHeight = m_height;
+        int savedHeight = height();
         // Restore floats from clean lines.
         RootInlineBox* line = firstRootBox();
         while (line != curr) {
-            if (Vector<RenderObject*>* cleanLineFloats = line->floatsPtr()) {
-                Vector<RenderObject*>::iterator end = cleanLineFloats->end();
-                for (Vector<RenderObject*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
+            if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
+                Vector<RenderBox*>::iterator end = cleanLineFloats->end();
+                for (Vector<RenderBox*>::iterator f = cleanLineFloats->begin(); f != end; ++f) {
                     insertFloatingObject(*f);
-                    m_height = (*f)->yPos() - (*f)->marginTop();
+                    setHeight((*f)->y() - (*f)->marginTop());
                     positionNewFloats();
                     ASSERT(floats[numCleanFloats].object == *f);
                     numCleanFloats++;
@@ -1242,7 +1244,7 @@
             }
             line = line->nextRootBox();
         }
-        m_height = savedHeight;
+        setHeight(savedHeight);
     }
 
     m_firstLine = !last;
@@ -1251,7 +1253,7 @@
     RenderObject* startObj;
     int pos = 0;
     if (last) {
-        m_height = last->blockHeight();
+        setHeight(last->blockHeight());
         startObj = last->lineBreakObj();
         pos = last->lineBreakPos();
         resolver.setStatus(last->lineBreakBidiStatus());
@@ -1311,12 +1313,12 @@
         if (resolver.status() != endLineStatus)
             return false;
 
-        int delta = m_height - endYPos;
+        int delta = height() - endYPos;
         if (!delta || !m_floatingObjects)
             return true;
 
         // See if any floats end in the range along which we want to shift the lines vertically.
-        int top = min(m_height, endYPos);
+        int top = min(height(), endYPos);
 
         RootInlineBox* lastLine = endLine;
         while (RootInlineBox* nextLine = lastLine->nextRootBox())
@@ -1347,10 +1349,10 @@
             if (result)
                 endYPos = line->blockHeight();
 
-            int delta = m_height - endYPos;
+            int delta = height() - endYPos;
             if (delta && m_floatingObjects) {
                 // See if any floats end in the range along which we want to shift the lines vertically.
-                int top = min(m_height, endYPos);
+                int top = min(height(), endYPos);
 
                 RootInlineBox* lastLine = endLine;
                 while (RootInlineBox* nextLine = lastLine->nextRootBox())
@@ -1459,7 +1461,7 @@
     while (!iterator.atEnd() && !requiresLineBox(iterator)) {
         RenderObject* object = iterator.obj;
         if (object->isFloating()) {
-            insertFloatingObject(object);
+            insertFloatingObject(toRenderBox(object));
         } else if (object->isPositioned()) {
             // FIXME: The math here is actually not really right.  It's a best-guess approximation that
             // will work for the common cases
@@ -1468,19 +1470,19 @@
                 // A relative positioned inline encloses us.  In this case, we also have to determine our
                 // position as though we were an inline.  Set |staticX| and |staticY| on the relative positioned
                 // inline so that we can obtain the value later.
-                c->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : rightOffset(m_height));
-                c->setStaticY(m_height);
+                c->setStaticX(style()->direction() == LTR ? leftOffset(height()) : rightOffset(height()));
+                c->setStaticY(height());
             }
     
             if (object->hasStaticX()) {
                 if (object->style()->isOriginalDisplayInlineType())
-                    object->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : width() - rightOffset(m_height));
+                    object->setStaticX(style()->direction() == LTR ? leftOffset(height()) : width() - rightOffset(height()));
                 else
                     object->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight());
             }
     
             if (object->hasStaticY())
-                object->setStaticY(m_height);
+                object->setStaticY(height());
         }
         iterator.increment();
     }
@@ -1488,13 +1490,13 @@
 
 int RenderBlock::skipLeadingWhitespace(InlineBidiResolver& resolver)
 {
-    int availableWidth = lineWidth(m_height);
+    int availableWidth = lineWidth(height());
     while (!resolver.position().atEnd() && !requiresLineBox(resolver.position())) {
         RenderObject* object = resolver.position().obj;
         if (object->isFloating()) {
-            insertFloatingObject(object);
+            insertFloatingObject(toRenderBox(object));
             positionNewFloats();
-            availableWidth = lineWidth(m_height);
+            availableWidth = lineWidth(height());
         } else if (object->isPositioned()) {
             // FIXME: The math here is actually not really right.  It's a best-guess approximation that
             // will work for the common cases
@@ -1503,19 +1505,19 @@
                 // A relative positioned inline encloses us.  In this case, we also have to determine our
                 // position as though we were an inline.  Set |staticX| and |staticY| on the relative positioned
                 // inline so that we can obtain the value later.
-                c->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : rightOffset(m_height));
-                c->setStaticY(m_height);
+                c->setStaticX(style()->direction() == LTR ? leftOffset(height()) : rightOffset(height()));
+                c->setStaticY(height());
             }
     
             if (object->hasStaticX()) {
                 if (object->style()->isOriginalDisplayInlineType())
-                    object->setStaticX(style()->direction() == LTR ? leftOffset(m_height) : width() - rightOffset(m_height));
+                    object->setStaticX(style()->direction() == LTR ? leftOffset(height()) : width() - rightOffset(height()));
                 else
                     object->setStaticX(style()->direction() == LTR ? borderLeft() + paddingLeft() : borderRight() + paddingRight());
             }
     
             if (object->hasStaticY())
-                object->setStaticY(m_height);
+                object->setStaticY(height());
         }
         resolver.increment();
     }
@@ -1545,7 +1547,7 @@
     ASSERT(widthToFit > availableWidth);
 
     int floatBottom;
-    int lastFloatBottom = m_height;
+    int lastFloatBottom = height();
     int newLineWidth = availableWidth;
     while (true) {
         floatBottom = nextFloatBottomBelow(lastFloatBottom);
@@ -1559,7 +1561,7 @@
     }
 
     if (newLineWidth > availableWidth) {
-        m_height = lastFloatBottom;
+        setHeight(lastFloatBottom);
         availableWidth = newLineWidth;
     }
 }
@@ -1652,13 +1654,14 @@
         if (o->isFloatingOrPositioned()) {
             // add to special objects...
             if (o->isFloating()) {
-                insertFloatingObject(o);
+                RenderBox* floatBox = toRenderBox(o);
+                insertFloatingObject(floatBox);
                 // check if it fits in the current line.
                 // If it does, position it now, otherwise, position
                 // it after moving to next line (in newLine() func)
-                if (floatsFitOnLine && o->width() + o->marginLeft() + o->marginRight() + w + tmpW <= width) {
+                if (floatsFitOnLine && floatBox->width() + floatBox->marginLeft() + floatBox->marginRight() + w + tmpW <= width) {
                     positionNewFloats();
-                    width = lineWidth(m_height);
+                    width = lineWidth(height());
                 } else
                     floatsFitOnLine = false;
             } else if (o->isPositioned()) {
@@ -1677,7 +1680,7 @@
                 // and determine our static y position now.
                 bool needToSetStaticY = o->hasStaticY();
                 if (o->hasStaticY() && isInlineType) {
-                    o->setStaticY(m_height);
+                    o->setStaticY(height());
                     needToSetStaticY = false;
                 }
                 
@@ -1726,6 +1729,8 @@
             tmpW += o->marginLeft() + o->borderLeft() + o->paddingLeft() +
                     o->marginRight() + o->borderRight() + o->paddingRight();
         } else if (o->isReplaced()) {
+            RenderBox* replacedBox = toRenderBox(o);
+
             // Break on replaced elements if either has normal white-space.
             if ((autoWrap || RenderStyle::autoWrap(lastWS)) && (!o->isImage() || allowImagesToBreak)) {
                 w += tmpW;
@@ -1755,7 +1760,7 @@
                     ignoringSpaces = true;
                 }
             } else
-                tmpW += o->width() + o->marginLeft() + o->marginRight() + inlineWidth(o);
+                tmpW += replacedBox->width() + replacedBox->marginLeft() + replacedBox->marginRight() + inlineWidth(o);
         } else if (o->isText()) {
             if (!pos)
                 appliedStartWidth = false;
@@ -2172,7 +2177,7 @@
 
 void RenderBlock::checkLinesForOverflow()
 {
-    m_overflowWidth = m_width;
+    m_overflowWidth = width();
     for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
         m_overflowLeft = min(curr->leftOverflow(), m_overflowLeft);
         m_overflowTop = min(curr->topOverflow(), m_overflowTop);