Use RenderElement instead of RenderObject in many places
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 02:40:50 +0000 (02:40 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 02:40:50 +0000 (02:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122078

Reviewed by Andreas Kling.

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj: Let Xcode do its thing to this file.

Source/WebCore:

* WebCore.exp.in: Updated for name changes.

* dom/ContainerNode.h: Moved renderer() here from Element.
* dom/Element.h: Moved renderer() from here to ContainerNode.
* render/RenderElement.h: Moved renderer() from Element to ContainerNode.

* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
(WebCore::AccessibilityImageMapLink::detachFromParent):
(WebCore::AccessibilityImageMapLink::elementPath):
(WebCore::AccessibilityImageMapLink::elementRect):
* accessibility/AccessibilityImageMapLink.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* bindings/objc/DOM.mm:
(-[DOMElement image]):
(-[DOMElement _font]):
(-[DOMElement _imageTIFFRepresentation]):
* css/CSSCanvasValue.cpp:
(WebCore::CSSCanvasValue::canvasChanged):
(WebCore::CSSCanvasValue::canvasResized):
(WebCore::CSSCanvasValue::canvasDestroyed):
(WebCore::CSSCanvasValue::fixedSize):
(WebCore::CSSCanvasValue::image):
* css/CSSCanvasValue.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computeRenderStyleForProperty):
* css/CSSCrossfadeValue.cpp:
(WebCore::subimageKnownToBeOpaque):
(WebCore::CSSCrossfadeValue::fixedSize):
(WebCore::CSSCrossfadeValue::knownToBeOpaque):
(WebCore::CSSCrossfadeValue::image):
(WebCore::CSSCrossfadeValue::crossfadeChanged):
* css/CSSCrossfadeValue.h:
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::fixedSize):
(WebCore::CSSFilterImageValue::knownToBeOpaque):
(WebCore::CSSFilterImageValue::image):
(WebCore::CSSFilterImageValue::filterImageChanged):
* css/CSSFilterImageValue.h:
* css/CSSFontSelector.cpp:
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
(WebCore::CSSGradientValue::addStops):
(WebCore::CSSGradientValue::knownToBeOpaque):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::createGradient):
* css/CSSGradientValue.h:
(WebCore::CSSGradientValue::fixedSize):
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::addClient):
(WebCore::CSSImageGeneratorValue::removeClient):
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque):
* css/CSSImageGeneratorValue.h:
(WebCore::CSSImageGeneratorValue::clients):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::knownToBeOpaque):
* css/CSSImageValue.h:
* css/DeprecatedStyleBuilder.cpp:
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::removeMarkersFromList):
(WebCore::DocumentMarkerController::repaintMarkers):
* dom/Element.cpp:
(WebCore::localZoomForRenderer):
(WebCore::adjustForLocalZoom):
(WebCore::Element::offsetParent):
(WebCore::Element::updateExistingPseudoElement):
* dom/ElementRareData.h:
(WebCore::ElementRareData::create):
(WebCore::ElementRareData::ElementRareData):
* dom/Node.cpp:
(WebCore::Node::ensureRareData):
* editing/DeleteButtonController.cpp:
(WebCore::isDeletableElement):
* editing/Editor.cpp:
(WebCore::Editor::hasBidiSelection):
(WebCore::Editor::baseWritingDirectionForSelectionStart):
* editing/EditorCommand.cpp:
(WebCore::verticalScrollDistance):
* editing/htmlediting.cpp:
(WebCore::directionOfEnclosingBlock):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::fontForSelection):
(WebCore::getImage):
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontForSelection):
(WebCore::getImage):
* editing/markup.cpp:
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::computePath):
(WebCore::HTMLAreaElement::computeRect):
(WebCore::HTMLAreaElement::setFocus):
* html/HTMLAreaElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::reset):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):
* html/HTMLFormControlElement.cpp:
(WebCore::updateFromElementCallback):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::rendererIsNeeded):
* html/HTMLFrameOwnerElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::x):
(WebCore::HTMLImageElement::y):
(WebCore::HTMLImageElement::willRespondToMouseClickEvents):
* html/HTMLMapElement.cpp:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::defaultEventHandler):
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::renderMeter):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::didRecalcStyle):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::willRespondToMouseClickEvents):
(WebCore::HTMLPlugInElement::defaultEventHandler):
(WebCore::HTMLPlugInElement::isKeyboardFocusable):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::defaultEventHandler):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::renderProgress):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::scrollToSelection):
(WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
(WebCore::HTMLSelectElement::selectOption):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::cellAbove):
* html/HTMLTextFormControlElement.cpp:
(WebCore::hasVisibleTextArea):
(WebCore::HTMLTextFormControlElement::setSelectionRange):
* html/InputType.h:
* html/parser/HTMLResourcePreloader.cpp:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlElement::setDisplayType):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::startDrag):
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* html/shadow/MeterShadowElement.cpp:
(WebCore::MeterShadowElement::rendererIsNeeded):
(WebCore::MeterInnerElement::rendererIsNeeded):
* inspector/InspectorOverlay.cpp:
* inspector/InspectorTimelineAgent.cpp:
* inspector/InspectorTimelineAgent.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::renderImageResource):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::currentFrameKnownToBeOpaque):
* loader/cache/CachedImage.h:
* mathml/MathMLElement.cpp:
* page/ContextMenuController.cpp:
* page/DragController.cpp:
(WebCore::DragController::draggableElement):
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::startPanScrolling):
(WebCore::EventHandler::autoscrollRenderer):
(WebCore::EventHandler::scrollOverflow):
(WebCore::EventHandler::logicalScrollOverflow):
(WebCore::EventHandler::subframeForTargetNode):
(WebCore::EventHandler::selectCursor):
(WebCore::layerForNode):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::clearGestureScrollNodes):
* page/EventHandler.h:
* page/FocusController.cpp:
* page/Frame.cpp:
(WebCore::Frame::ownerRenderer):
(WebCore::Frame::visiblePositionForPoint):
(WebCore::Frame::nodeImage):
* page/FrameView.cpp:
(WebCore::FrameView::applyOverflowToViewport):
(WebCore::FrameView::applyPaginationToViewport):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::isEnclosedInCompositingLayer):
(WebCore::FrameView::embeddedContentBox):
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::removeSlowRepaintObject):
(WebCore::FrameView::addViewportConstrainedObject):
(WebCore::FrameView::removeViewportConstrainedObject):
(WebCore::FrameView::scrollContentsFastPath):
(WebCore::FrameView::repaintSlowRepaintObjects):
(WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
(WebCore::FrameView::updateOverflowStatus):
(WebCore::FrameView::updateScrollCorner):
(WebCore::FrameView::paintContents):
(WebCore::FrameView::convertFromRenderer):
(WebCore::FrameView::convertToRenderer):
* page/FrameView.h:
* page/PageSerializer.cpp:
(WebCore::PageSerializer::addImageToResources):
* page/PageSerializer.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::AnimationBase):
(WebCore::AnimationBase::updateStateMachine):
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::renderer):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
(WebCore::AnimationControllerPrivate::clear):
(WebCore::AnimationControllerPrivate::updateAnimations):
(WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer):
(WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
(WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
(WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
(WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
(WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
(WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
(WebCore::AnimationController::cancelAnimations):
(WebCore::AnimationController::updateAnimations):
(WebCore::AnimationController::getAnimatedStyleForRenderer):
(WebCore::AnimationController::notifyAnimationStarted):
(WebCore::AnimationController::pauseAnimationAtTime):
(WebCore::AnimationController::pauseTransitionAtTime):
(WebCore::AnimationController::isRunningAnimationOnRenderer):
(WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
* page/animation/AnimationController.h:
* page/animation/AnimationControllerPrivate.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::crossfadeBlend):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
(WebCore::CompositeAnimation::updateKeyframeAnimations):
(WebCore::CompositeAnimation::animate):
* page/animation/CompositeAnimation.h:
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::ImplicitAnimation):
(WebCore::ImplicitAnimation::animate):
(WebCore::ImplicitAnimation::pauseAnimation):
(WebCore::ImplicitAnimation::sendTransitionEvent):
* page/animation/ImplicitAnimation.h:
(WebCore::ImplicitAnimation::create):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::animate):
(WebCore::KeyframeAnimation::pauseAnimation):
(WebCore::KeyframeAnimation::endAnimation):
(WebCore::KeyframeAnimation::sendAnimationEvent):
* page/animation/KeyframeAnimation.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::passWidgetMouseDownEventToWidget):
(WebCore::EventHandler::passSubframeEventToSubframe):
* page/mac/FrameSnapshottingMac.mm:
(WebCore::snapshotDragImage):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::paint):
* rendering/CounterNode.cpp:
(WebCore::CounterNode::CounterNode):
(WebCore::CounterNode::create):
* rendering/CounterNode.h:
(WebCore::CounterNode::owner):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
(WebCore::FilterEffectRenderer::build):
* rendering/FilterEffectRenderer.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::spellingToolTip):
(WebCore::HitTestResult::title):
(WebCore::HitTestResult::innerTextIfTruncated):
(WebCore::HitTestResult::image):
* rendering/LayoutRepainter.cpp:
(WebCore::LayoutRepainter::LayoutRepainter):
* rendering/LayoutRepainter.h:
* rendering/LayoutState.h:
(WebCore::LayoutState::LayoutState):
* rendering/LineWidth.h:
* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::isContainingBlockCandidateForAbsolutelyPositionedObject):
(WebCore::isNonRenderBlockInline):
(WebCore::containingBlockForFixedPosition):
(WebCore::containingBlockForAbsolutePosition):
(WebCore::containingBlockForObjectInFlow):
(WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(WebCore::PaintInfo::updateSubtreePaintRootForChildren):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):
(WebCore::RenderBox::paintFillLayer):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderBoxModelObject.h:
* rendering/RenderCounter.cpp:
(WebCore::nextInPreOrder):
(WebCore::planCounter):
(WebCore::makeCounterNode):
(WebCore::RenderCounter::originalText):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement):
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::removeChildInternal):
(WebCore::RenderElement::willBeDestroyed):
(WebCore::RenderElement::rendererForRootBackground):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::initialize):
* rendering/RenderImageResource.h:
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::initialize):
* rendering/RenderImageResourceStyleImage.h:
(WebCore::RenderImageResourceStyleImage::create):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame):
(WebCore::RenderLayerCompositor::requiresCompositingLayer):
(WebCore::RenderLayerCompositor::canBeComposited):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore):
(WebCore::RenderLayerCompositor::reasonsForCompositing):
(WebCore::RenderLayerCompositor::requiresCompositingForTransform):
(WebCore::RenderLayerCompositor::requiresCompositingForVideo):
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
(WebCore::RenderLayerCompositor::requiresCompositingForFrame):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason):
(WebCore::RenderLayerCompositor::requiresCompositingForFilters):
(WebCore::RenderLayerCompositor::requiresCompositingForBlending):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation):
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock):
(WebCore::mustRepaintFillLayers):
(WebCore::RenderObject::borderImageIsLoadedAndCanBeRendered):
(WebCore::RenderObject::willBeDestroyed):
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::rendererOwningScrollbar):
* rendering/RenderScrollbarPart.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTableCell.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::hasOpaqueImage):
* rendering/style/FillLayer.h:
* rendering/style/KeyframeList.h:
(WebCore::KeyframeList::KeyframeList):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::imageSize):
(WebCore::StyleCachedImage::computeIntrinsicDimensions):
(WebCore::StyleCachedImage::setContainerSizeForRenderer):
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):
(WebCore::StyleCachedImage::image):
(WebCore::StyleCachedImage::knownToBeOpaque):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleCachedImageSet.cpp:
(WebCore::StyleCachedImageSet::imageSize):
(WebCore::StyleCachedImageSet::computeIntrinsicDimensions):
(WebCore::StyleCachedImageSet::setContainerSizeForRenderer):
(WebCore::StyleCachedImageSet::addClient):
(WebCore::StyleCachedImageSet::removeClient):
(WebCore::StyleCachedImageSet::image):
(WebCore::StyleCachedImageSet::knownToBeOpaque):
* rendering/style/StyleCachedImageSet.h:
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::imageSize):
(WebCore::StyleGeneratedImage::computeIntrinsicDimensions):
(WebCore::StyleGeneratedImage::addClient):
(WebCore::StyleGeneratedImage::removeClient):
(WebCore::StyleGeneratedImage::image):
(WebCore::StyleGeneratedImage::knownToBeOpaque):
* rendering/style/StyleGeneratedImage.h:
* rendering/style/StyleImage.h:
(WebCore::StyleImage::imagesEquivalent):
* rendering/style/StylePendingImage.h:
(WebCore::StylePendingImage::cssImageValue):
(WebCore::StylePendingImage::cssImageGeneratorValue):
(WebCore::StylePendingImage::cssCursorImageValue):
(WebCore::StylePendingImage::cssImageSetValue):
(WebCore::StylePendingImage::computeIntrinsicDimensions):
* testing/Internals.cpp:
(WebCore::Internals::boundingBox):
(WebCore::Internals::isSelectPopupVisible):
(WebCore::Internals::isPluginUnavailabilityIndicatorObscured):
Use RenderElement instead of RenderObject where it was easy to do so.
For local variables holding the return value of renderer() functions,
use auto instead, so the most-specific possible type will be used,
without having to figure out what that is in each case. Also use some
more OVERRIDE and FINAL and use nullptr instead of 0. And replace some
cryptic short local variable names with words.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156622 268f45cc-cd09-0410-ab3c-d52691b4dbfc

138 files changed:
Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
Source/ThirdParty/ANGLE/ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
Source/WebCore/accessibility/AccessibilityImageMapLink.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/bindings/objc/DOM.mm
Source/WebCore/css/CSSCanvasValue.cpp
Source/WebCore/css/CSSCanvasValue.h
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSCrossfadeValue.cpp
Source/WebCore/css/CSSCrossfadeValue.h
Source/WebCore/css/CSSFilterImageValue.cpp
Source/WebCore/css/CSSFilterImageValue.h
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSGradientValue.cpp
Source/WebCore/css/CSSGradientValue.h
Source/WebCore/css/CSSImageGeneratorValue.cpp
Source/WebCore/css/CSSImageGeneratorValue.h
Source/WebCore/css/CSSImageValue.cpp
Source/WebCore/css/CSSImageValue.h
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/dom/ContainerNode.h
Source/WebCore/dom/DocumentMarkerController.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementRareData.h
Source/WebCore/dom/Node.cpp
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/editing/markup.cpp
Source/WebCore/html/HTMLAreaElement.cpp
Source/WebCore/html/HTMLAreaElement.h
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.h
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLMapElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMeterElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLProgressElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTableCellElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/InputType.h
Source/WebCore/html/parser/HTMLResourcePreloader.cpp
Source/WebCore/html/shadow/MediaControlElementTypes.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MeterShadowElement.cpp
Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/PageSerializer.h
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/page/animation/AnimationBase.h
Source/WebCore/page/animation/AnimationController.cpp
Source/WebCore/page/animation/AnimationController.h
Source/WebCore/page/animation/AnimationControllerPrivate.h
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/page/animation/CompositeAnimation.cpp
Source/WebCore/page/animation/CompositeAnimation.h
Source/WebCore/page/animation/ImplicitAnimation.cpp
Source/WebCore/page/animation/ImplicitAnimation.h
Source/WebCore/page/animation/KeyframeAnimation.cpp
Source/WebCore/page/animation/KeyframeAnimation.h
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/mac/FrameSnapshottingMac.mm
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
Source/WebCore/rendering/CounterNode.cpp
Source/WebCore/rendering/CounterNode.h
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/FilterEffectRenderer.h
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/LayoutRepainter.cpp
Source/WebCore/rendering/LayoutRepainter.h
Source/WebCore/rendering/LayoutState.h
Source/WebCore/rendering/LineWidth.h
Source/WebCore/rendering/LogicalSelectionOffsetCaches.h
Source/WebCore/rendering/PaintInfo.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderImageResource.cpp
Source/WebCore/rendering/RenderImageResource.h
Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
Source/WebCore/rendering/RenderImageResourceStyleImage.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderScrollbarPart.cpp
Source/WebCore/rendering/RenderScrollbarPart.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/style/FillLayer.cpp
Source/WebCore/rendering/style/FillLayer.h
Source/WebCore/rendering/style/KeyframeList.h
Source/WebCore/rendering/style/StyleCachedImage.cpp
Source/WebCore/rendering/style/StyleCachedImage.h
Source/WebCore/rendering/style/StyleCachedImageSet.cpp
Source/WebCore/rendering/style/StyleCachedImageSet.h
Source/WebCore/rendering/style/StyleGeneratedImage.cpp
Source/WebCore/rendering/style/StyleGeneratedImage.h
Source/WebCore/rendering/style/StyleImage.h
Source/WebCore/rendering/style/StylePendingImage.h
Source/WebCore/style/StyleResolveTree.cpp
Source/WebCore/testing/Internals.cpp

index d642b7271cb2ba6781cdbf2c25c93af1add95f3a..085d9685343899bdfce2995dd4566e9c027c4a6b 100644 (file)
                49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltInFunctionEmulator.h; sourceTree = "<group>"; };
                5CB13FD2179DB3FD001F851D /* DetectCallDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DetectCallDepth.cpp; sourceTree = "<group>"; };
                5CB13FD3179DB3FD001F851D /* DetectCallDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetectCallDepth.h; sourceTree = "<group>"; };
-               5CB13FDF179F4658001F851D /* ExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpressionParser.cpp; path = ExpressionParser.cpp; sourceTree = "<group>"; };
-               5CB13FE0179F4658001F851D /* glslang_lex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glslang_lex.cpp; path = glslang_lex.cpp; sourceTree = "<group>"; };
-               5CB13FE1179F4658001F851D /* glslang_tab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glslang_tab.cpp; path = glslang_tab.cpp; sourceTree = "<group>"; };
-               5CB13FE2179F4658001F851D /* glslang_tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glslang_tab.h; path = glslang_tab.h; sourceTree = "<group>"; };
-               5CB13FE3179F4658001F851D /* Tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tokenizer.cpp; path = Tokenizer.cpp; sourceTree = "<group>"; };
+               5CB13FDF179F4658001F851D /* ExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExpressionParser.cpp; sourceTree = "<group>"; };
+               5CB13FE0179F4658001F851D /* glslang_lex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glslang_lex.cpp; sourceTree = "<group>"; };
+               5CB13FE1179F4658001F851D /* glslang_tab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glslang_tab.cpp; sourceTree = "<group>"; };
+               5CB13FE2179F4658001F851D /* glslang_tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glslang_tab.h; sourceTree = "<group>"; };
+               5CB13FE3179F4658001F851D /* Tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tokenizer.cpp; sourceTree = "<group>"; };
                5D7C59C51208C68B001C873E /* ANGLE.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ANGLE.xcconfig; sourceTree = "<group>"; };
                5D7C59C61208C68B001C873E /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
                5D7C59C71208C68B001C873E /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
index d95da502ce44f9c263ee68cb06994996376004da..c6a8ed09cc61da30d58e086c0b02ec4ee692766f 100644 (file)
@@ -1,3 +1,12 @@
+2013-09-29  Darin Adler  <darin@apple.com>
+
+        Use RenderElement instead of RenderObject in many places
+        https://bugs.webkit.org/show_bug.cgi?id=122078
+
+        Reviewed by Andreas Kling.
+
+        * ANGLE.xcodeproj/project.pbxproj: Let Xcode do its thing to this file.
+
 2013-09-24  Mark Rowe  <mrowe@apple.com>
 
         <rdar://problem/14971518> WebKit should build against the Xcode default toolchain when targeting OS X 10.8
index 0910b3a67427ba6454dc3f40caa8fde8d98f2564..976c78ba38285ec5b7afc65154317417f690ea52 100644 (file)
@@ -1,3 +1,397 @@
+2013-09-29  Darin Adler  <darin@apple.com>
+
+        Use RenderElement instead of RenderObject in many places
+        https://bugs.webkit.org/show_bug.cgi?id=122078
+
+        Reviewed by Andreas Kling.
+
+        * WebCore.exp.in: Updated for name changes.
+
+        * dom/ContainerNode.h: Moved renderer() here from Element.
+        * dom/Element.h: Moved renderer() from here to ContainerNode.
+        * render/RenderElement.h: Moved renderer() from Element to ContainerNode.
+
+        * accessibility/AccessibilityImageMapLink.cpp:
+        (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
+        (WebCore::AccessibilityImageMapLink::detachFromParent):
+        (WebCore::AccessibilityImageMapLink::elementPath):
+        (WebCore::AccessibilityImageMapLink::elementRect):
+        * accessibility/AccessibilityImageMapLink.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+        * bindings/objc/DOM.mm:
+        (-[DOMElement image]):
+        (-[DOMElement _font]):
+        (-[DOMElement _imageTIFFRepresentation]):
+        * css/CSSCanvasValue.cpp:
+        (WebCore::CSSCanvasValue::canvasChanged):
+        (WebCore::CSSCanvasValue::canvasResized):
+        (WebCore::CSSCanvasValue::canvasDestroyed):
+        (WebCore::CSSCanvasValue::fixedSize):
+        (WebCore::CSSCanvasValue::image):
+        * css/CSSCanvasValue.h:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::computeRenderStyleForProperty):
+        * css/CSSCrossfadeValue.cpp:
+        (WebCore::subimageKnownToBeOpaque):
+        (WebCore::CSSCrossfadeValue::fixedSize):
+        (WebCore::CSSCrossfadeValue::knownToBeOpaque):
+        (WebCore::CSSCrossfadeValue::image):
+        (WebCore::CSSCrossfadeValue::crossfadeChanged):
+        * css/CSSCrossfadeValue.h:
+        * css/CSSFilterImageValue.cpp:
+        (WebCore::CSSFilterImageValue::fixedSize):
+        (WebCore::CSSFilterImageValue::knownToBeOpaque):
+        (WebCore::CSSFilterImageValue::image):
+        (WebCore::CSSFilterImageValue::filterImageChanged):
+        * css/CSSFilterImageValue.h:
+        * css/CSSFontSelector.cpp:
+        * css/CSSGradientValue.cpp:
+        (WebCore::CSSGradientValue::image):
+        (WebCore::CSSGradientValue::addStops):
+        (WebCore::CSSGradientValue::knownToBeOpaque):
+        (WebCore::CSSLinearGradientValue::createGradient):
+        (WebCore::CSSRadialGradientValue::createGradient):
+        * css/CSSGradientValue.h:
+        (WebCore::CSSGradientValue::fixedSize):
+        * css/CSSImageGeneratorValue.cpp:
+        (WebCore::CSSImageGeneratorValue::addClient):
+        (WebCore::CSSImageGeneratorValue::removeClient):
+        (WebCore::CSSImageGeneratorValue::image):
+        (WebCore::CSSImageGeneratorValue::fixedSize):
+        (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
+        * css/CSSImageGeneratorValue.h:
+        (WebCore::CSSImageGeneratorValue::clients):
+        * css/CSSImageValue.cpp:
+        (WebCore::CSSImageValue::knownToBeOpaque):
+        * css/CSSImageValue.h:
+        * css/DeprecatedStyleBuilder.cpp:
+        * dom/DocumentMarkerController.cpp:
+        (WebCore::DocumentMarkerController::removeMarkersFromList):
+        (WebCore::DocumentMarkerController::repaintMarkers):
+        * dom/Element.cpp:
+        (WebCore::localZoomForRenderer):
+        (WebCore::adjustForLocalZoom):
+        (WebCore::Element::offsetParent):
+        (WebCore::Element::updateExistingPseudoElement):
+        * dom/ElementRareData.h:
+        (WebCore::ElementRareData::create):
+        (WebCore::ElementRareData::ElementRareData):
+        * dom/Node.cpp:
+        (WebCore::Node::ensureRareData):
+        * editing/DeleteButtonController.cpp:
+        (WebCore::isDeletableElement):
+        * editing/Editor.cpp:
+        (WebCore::Editor::hasBidiSelection):
+        (WebCore::Editor::baseWritingDirectionForSelectionStart):
+        * editing/EditorCommand.cpp:
+        (WebCore::verticalScrollDistance):
+        * editing/htmlediting.cpp:
+        (WebCore::directionOfEnclosingBlock):
+        * editing/ios/EditorIOS.mm:
+        (WebCore::Editor::fontForSelection):
+        (WebCore::getImage):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::fontForSelection):
+        (WebCore::getImage):
+        * editing/markup.cpp:
+        * html/HTMLAreaElement.cpp:
+        (WebCore::HTMLAreaElement::computePath):
+        (WebCore::HTMLAreaElement::computeRect):
+        (WebCore::HTMLAreaElement::setFocus):
+        * html/HTMLAreaElement.h:
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::reset):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::setInnerText):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::updateFromElementCallback):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::rendererIsNeeded):
+        * html/HTMLFrameOwnerElement.h:
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::x):
+        (WebCore::HTMLImageElement::y):
+        (WebCore::HTMLImageElement::willRespondToMouseClickEvents):
+        * html/HTMLMapElement.cpp:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::defaultEventHandler):
+        * html/HTMLMeterElement.cpp:
+        (WebCore::HTMLMeterElement::renderMeter):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::didRecalcStyle):
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::HTMLPlugInElement::willRespondToMouseClickEvents):
+        (WebCore::HTMLPlugInElement::defaultEventHandler):
+        (WebCore::HTMLPlugInElement::isKeyboardFocusable):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::defaultEventHandler):
+        * html/HTMLProgressElement.cpp:
+        (WebCore::HTMLProgressElement::renderProgress):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::scrollToSelection):
+        (WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
+        (WebCore::HTMLSelectElement::selectOption):
+        * html/HTMLTableCellElement.cpp:
+        (WebCore::HTMLTableCellElement::cellAbove):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::hasVisibleTextArea):
+        (WebCore::HTMLTextFormControlElement::setSelectionRange):
+        * html/InputType.h:
+        * html/parser/HTMLResourcePreloader.cpp:
+        * html/shadow/MediaControlElementTypes.cpp:
+        (WebCore::MediaControlElement::setDisplayType):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::startDrag):
+        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
+        * html/shadow/MeterShadowElement.cpp:
+        (WebCore::MeterShadowElement::rendererIsNeeded):
+        (WebCore::MeterInnerElement::rendererIsNeeded):
+        * inspector/InspectorOverlay.cpp:
+        * inspector/InspectorTimelineAgent.cpp:
+        * inspector/InspectorTimelineAgent.h:
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::renderImageResource):
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::currentFrameKnownToBeOpaque):
+        * loader/cache/CachedImage.h:
+        * mathml/MathMLElement.cpp:
+        * page/ContextMenuController.cpp:
+        * page/DragController.cpp:
+        (WebCore::DragController::draggableElement):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::EventHandler):
+        (WebCore::EventHandler::clear):
+        (WebCore::EventHandler::startPanScrolling):
+        (WebCore::EventHandler::autoscrollRenderer):
+        (WebCore::EventHandler::scrollOverflow):
+        (WebCore::EventHandler::logicalScrollOverflow):
+        (WebCore::EventHandler::subframeForTargetNode):
+        (WebCore::EventHandler::selectCursor):
+        (WebCore::layerForNode):
+        (WebCore::EventHandler::handleWheelEvent):
+        (WebCore::EventHandler::clearGestureScrollNodes):
+        * page/EventHandler.h:
+        * page/FocusController.cpp:
+        * page/Frame.cpp:
+        (WebCore::Frame::ownerRenderer):
+        (WebCore::Frame::visiblePositionForPoint):
+        (WebCore::Frame::nodeImage):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::applyOverflowToViewport):
+        (WebCore::FrameView::applyPaginationToViewport):
+        (WebCore::FrameView::calculateScrollbarModesForLayout):
+        (WebCore::FrameView::isEnclosedInCompositingLayer):
+        (WebCore::FrameView::embeddedContentBox):
+        (WebCore::FrameView::addSlowRepaintObject):
+        (WebCore::FrameView::removeSlowRepaintObject):
+        (WebCore::FrameView::addViewportConstrainedObject):
+        (WebCore::FrameView::removeViewportConstrainedObject):
+        (WebCore::FrameView::scrollContentsFastPath):
+        (WebCore::FrameView::repaintSlowRepaintObjects):
+        (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
+        (WebCore::FrameView::updateOverflowStatus):
+        (WebCore::FrameView::updateScrollCorner):
+        (WebCore::FrameView::paintContents):
+        (WebCore::FrameView::convertFromRenderer):
+        (WebCore::FrameView::convertToRenderer):
+        * page/FrameView.h:
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::addImageToResources):
+        * page/PageSerializer.h:
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::AnimationBase):
+        (WebCore::AnimationBase::updateStateMachine):
+        * page/animation/AnimationBase.h:
+        (WebCore::AnimationBase::renderer):
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
+        (WebCore::AnimationControllerPrivate::clear):
+        (WebCore::AnimationControllerPrivate::updateAnimations):
+        (WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer):
+        (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
+        (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
+        (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
+        (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
+        (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
+        (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
+        (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
+        (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
+        (WebCore::AnimationController::cancelAnimations):
+        (WebCore::AnimationController::updateAnimations):
+        (WebCore::AnimationController::getAnimatedStyleForRenderer):
+        (WebCore::AnimationController::notifyAnimationStarted):
+        (WebCore::AnimationController::pauseAnimationAtTime):
+        (WebCore::AnimationController::pauseTransitionAtTime):
+        (WebCore::AnimationController::isRunningAnimationOnRenderer):
+        (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
+        * page/animation/AnimationController.h:
+        * page/animation/AnimationControllerPrivate.h:
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::crossfadeBlend):
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::updateTransitions):
+        (WebCore::CompositeAnimation::updateKeyframeAnimations):
+        (WebCore::CompositeAnimation::animate):
+        * page/animation/CompositeAnimation.h:
+        * page/animation/ImplicitAnimation.cpp:
+        (WebCore::ImplicitAnimation::ImplicitAnimation):
+        (WebCore::ImplicitAnimation::animate):
+        (WebCore::ImplicitAnimation::pauseAnimation):
+        (WebCore::ImplicitAnimation::sendTransitionEvent):
+        * page/animation/ImplicitAnimation.h:
+        (WebCore::ImplicitAnimation::create):
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::KeyframeAnimation):
+        (WebCore::KeyframeAnimation::animate):
+        (WebCore::KeyframeAnimation::pauseAnimation):
+        (WebCore::KeyframeAnimation::endAnimation):
+        (WebCore::KeyframeAnimation::sendAnimationEvent):
+        * page/animation/KeyframeAnimation.h:
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+        (WebCore::EventHandler::passSubframeEventToSubframe):
+        * page/mac/FrameSnapshottingMac.mm:
+        (WebCore::snapshotDragImage):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::paint):
+        * rendering/CounterNode.cpp:
+        (WebCore::CounterNode::CounterNode):
+        (WebCore::CounterNode::create):
+        * rendering/CounterNode.h:
+        (WebCore::CounterNode::owner):
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRenderer::buildReferenceFilter):
+        (WebCore::FilterEffectRenderer::build):
+        * rendering/FilterEffectRenderer.h:
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::spellingToolTip):
+        (WebCore::HitTestResult::title):
+        (WebCore::HitTestResult::innerTextIfTruncated):
+        (WebCore::HitTestResult::image):
+        * rendering/LayoutRepainter.cpp:
+        (WebCore::LayoutRepainter::LayoutRepainter):
+        * rendering/LayoutRepainter.h:
+        * rendering/LayoutState.h:
+        (WebCore::LayoutState::LayoutState):
+        * rendering/LineWidth.h:
+        * rendering/LogicalSelectionOffsetCaches.h:
+        (WebCore::isContainingBlockCandidateForAbsolutelyPositionedObject):
+        (WebCore::isNonRenderBlockInline):
+        (WebCore::containingBlockForFixedPosition):
+        (WebCore::containingBlockForAbsolutePosition):
+        (WebCore::containingBlockForObjectInFlow):
+        (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
+        * rendering/PaintInfo.h:
+        (WebCore::PaintInfo::PaintInfo):
+        (WebCore::PaintInfo::updateSubtreePaintRootForChildren):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintFillLayers):
+        (WebCore::RenderBox::paintFillLayer):
+        * rendering/RenderBox.h:
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+        * rendering/RenderBoxModelObject.h:
+        * rendering/RenderCounter.cpp:
+        (WebCore::nextInPreOrder):
+        (WebCore::planCounter):
+        (WebCore::makeCounterNode):
+        (WebCore::RenderCounter::originalText):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::~RenderElement):
+        (WebCore::RenderElement::insertChildInternal):
+        (WebCore::RenderElement::removeChildInternal):
+        (WebCore::RenderElement::willBeDestroyed):
+        (WebCore::RenderElement::rendererForRootBackground):
+        * rendering/RenderImageResource.cpp:
+        (WebCore::RenderImageResource::initialize):
+        * rendering/RenderImageResource.h:
+        * rendering/RenderImageResourceStyleImage.cpp:
+        (WebCore::RenderImageResourceStyleImage::initialize):
+        * rendering/RenderImageResourceStyleImage.h:
+        (WebCore::RenderImageResourceStyleImage::create):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame):
+        (WebCore::RenderLayerCompositor::requiresCompositingLayer):
+        (WebCore::RenderLayerCompositor::canBeComposited):
+        (WebCore::RenderLayerCompositor::requiresOwnBackingStore):
+        (WebCore::RenderLayerCompositor::reasonsForCompositing):
+        (WebCore::RenderLayerCompositor::requiresCompositingForTransform):
+        (WebCore::RenderLayerCompositor::requiresCompositingForVideo):
+        (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
+        (WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
+        (WebCore::RenderLayerCompositor::requiresCompositingForFrame):
+        (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
+        (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason):
+        (WebCore::RenderLayerCompositor::requiresCompositingForFilters):
+        (WebCore::RenderLayerCompositor::requiresCompositingForBlending):
+        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
+        (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation):
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::containingBlock):
+        (WebCore::mustRepaintFillLayers):
+        (WebCore::RenderObject::borderImageIsLoadedAndCanBeRendered):
+        (WebCore::RenderObject::willBeDestroyed):
+        * rendering/RenderScrollbarPart.cpp:
+        (WebCore::RenderScrollbarPart::rendererOwningScrollbar):
+        * rendering/RenderScrollbarPart.h:
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintBackgroundsBehindCell):
+        * rendering/RenderTableCell.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::RenderView):
+        * rendering/style/FillLayer.cpp:
+        (WebCore::FillLayer::hasOpaqueImage):
+        * rendering/style/FillLayer.h:
+        * rendering/style/KeyframeList.h:
+        (WebCore::KeyframeList::KeyframeList):
+        * rendering/style/StyleCachedImage.cpp:
+        (WebCore::StyleCachedImage::imageSize):
+        (WebCore::StyleCachedImage::computeIntrinsicDimensions):
+        (WebCore::StyleCachedImage::setContainerSizeForRenderer):
+        (WebCore::StyleCachedImage::addClient):
+        (WebCore::StyleCachedImage::removeClient):
+        (WebCore::StyleCachedImage::image):
+        (WebCore::StyleCachedImage::knownToBeOpaque):
+        * rendering/style/StyleCachedImage.h:
+        * rendering/style/StyleCachedImageSet.cpp:
+        (WebCore::StyleCachedImageSet::imageSize):
+        (WebCore::StyleCachedImageSet::computeIntrinsicDimensions):
+        (WebCore::StyleCachedImageSet::setContainerSizeForRenderer):
+        (WebCore::StyleCachedImageSet::addClient):
+        (WebCore::StyleCachedImageSet::removeClient):
+        (WebCore::StyleCachedImageSet::image):
+        (WebCore::StyleCachedImageSet::knownToBeOpaque):
+        * rendering/style/StyleCachedImageSet.h:
+        * rendering/style/StyleGeneratedImage.cpp:
+        (WebCore::StyleGeneratedImage::imageSize):
+        (WebCore::StyleGeneratedImage::computeIntrinsicDimensions):
+        (WebCore::StyleGeneratedImage::addClient):
+        (WebCore::StyleGeneratedImage::removeClient):
+        (WebCore::StyleGeneratedImage::image):
+        (WebCore::StyleGeneratedImage::knownToBeOpaque):
+        * rendering/style/StyleGeneratedImage.h:
+        * rendering/style/StyleImage.h:
+        (WebCore::StyleImage::imagesEquivalent):
+        * rendering/style/StylePendingImage.h:
+        (WebCore::StylePendingImage::cssImageValue):
+        (WebCore::StylePendingImage::cssImageGeneratorValue):
+        (WebCore::StylePendingImage::cssCursorImageValue):
+        (WebCore::StylePendingImage::cssImageSetValue):
+        (WebCore::StylePendingImage::computeIntrinsicDimensions):
+        * testing/Internals.cpp:
+        (WebCore::Internals::boundingBox):
+        (WebCore::Internals::isSelectPopupVisible):
+        (WebCore::Internals::isPluginUnavailabilityIndicatorObscured):
+        Use RenderElement instead of RenderObject where it was easy to do so.
+        For local variables holding the return value of renderer() functions,
+        use auto instead, so the most-specific possible type will be used,
+        without having to figure out what that is in each case. Also use some
+        more OVERRIDE and FINAL and use nullptr instead of 0. And replace some
+        cryptic short local variable names with words.
+
 2013-09-29  Philip Rogers  <pdr@google.com>
 
         Repaint borders and outlines on pseudo content changes
index 497aadf55896d6a4b47b0078be11e46e305ebc30..eb58a2a31b39fe85b156fe36dd05904afbc72e7a 100644 (file)
@@ -638,8 +638,8 @@ __ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE
 __ZN7WebCore18proxyServersForURLERKNS_3URLEPKNS_17NetworkingContextE
 __ZN7WebCore19AnimationController16resumeAnimationsEv
 __ZN7WebCore19AnimationController17suspendAnimationsEv
-__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKN3WTF12AtomicStringEd
-__ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKN3WTF6StringEd
+__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_13RenderElementERKN3WTF12AtomicStringEd
+__ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_13RenderElementERKN3WTF6StringEd
 __ZN7WebCore19AnimationController36setAllowsNewAnimationsWhileSuspendedEb
 __ZN7WebCore19HTMLTextAreaElement8setValueERKN3WTF6StringE
 __ZN7WebCore19LayerFlushScheduler10invalidateEv
@@ -1693,11 +1693,11 @@ __ZNK7WebCore9FrameView11needsLayoutEv
 __ZNK7WebCore9FrameView13isTransparentEv
 __ZNK7WebCore9FrameView13paintBehaviorEv
 __ZNK7WebCore9FrameView14didFirstLayoutEv
-__ZNK7WebCore9FrameView17convertToRendererEPKNS_12RenderObjectERKNS_7IntRectE
-__ZNK7WebCore9FrameView17convertToRendererEPKNS_12RenderObjectERKNS_8IntPointE
+__ZNK7WebCore9FrameView17convertToRendererEPKNS_13RenderElementERKNS_7IntRectE
+__ZNK7WebCore9FrameView17convertToRendererEPKNS_13RenderElementERKNS_8IntPointE
 __ZNK7WebCore9FrameView19baseBackgroundColorEv
-__ZNK7WebCore9FrameView19convertFromRendererEPKNS_12RenderObjectERKNS_7IntRectE
-__ZNK7WebCore9FrameView19convertFromRendererEPKNS_12RenderObjectERKNS_8IntPointE
+__ZNK7WebCore9FrameView19convertFromRendererEPKNS_13RenderElementERKNS_7IntRectE
+__ZNK7WebCore9FrameView19convertFromRendererEPKNS_13RenderElementERKNS_8IntPointE
 __ZNK7WebCore9FrameView20isSoftwareRenderableEv
 __ZNK7WebCore9FrameView21maximumScrollPositionEv
 __ZNK7WebCore9FrameView21minimumScrollPositionEv
index 791bf1c4ecbfff21bf67773fe3bea08113953ecb..5c327792530a5950aaa5dc5cfe5dce3f27e530da 100644 (file)
@@ -134,14 +134,14 @@ String AccessibilityImageMapLink::title() const
     return String();
 }
 
-RenderObject* AccessibilityImageMapLink::imageMapLinkRenderer() const
+RenderElement* AccessibilityImageMapLink::imageMapLinkRenderer() const
 {
-    if (!m_mapElement.get() || !m_areaElement.get())
-        return 0;
+    if (!m_mapElement || !m_areaElement)
+        return nullptr;
 
-    RenderObject* renderer = 0;
+    RenderElement* renderer = nullptr;
     if (m_parent && m_parent->isAccessibilityRenderObject())
-        renderer = static_cast<AccessibilityRenderObject*>(m_parent)->renderer();
+        renderer = toRenderElement(static_cast<AccessibilityRenderObject*>(m_parent)->renderer());
     else
         renderer = m_mapElement->renderer();
     
@@ -151,13 +151,13 @@ RenderObject* AccessibilityImageMapLink::imageMapLinkRenderer() const
 void AccessibilityImageMapLink::detachFromParent()
 {
     AccessibilityMockObject::detachFromParent();
-    m_areaElement = 0;
-    m_mapElement = 0;
+    m_areaElement = nullptr;
+    m_mapElement = nullptr;
 }
 
 Path AccessibilityImageMapLink::elementPath() const
 {
-    RenderObject* renderer = imageMapLinkRenderer();
+    auto renderer = imageMapLinkRenderer();
     if (!renderer)
         return Path();
     
@@ -166,7 +166,7 @@ Path AccessibilityImageMapLink::elementPath() const
     
 LayoutRect AccessibilityImageMapLink::elementRect() const
 {
-    RenderObject* renderer = imageMapLinkRenderer();
+    auto renderer = imageMapLinkRenderer();
     if (!renderer)
         return LayoutRect();
     
index 2f1fb0b7272452b6b3bbade8140decfa414224a4..4600e3c41d5fc951882d3cfd99696fc6da0de150 100644 (file)
@@ -75,7 +75,7 @@ private:
     virtual void detachFromParent() OVERRIDE;
 
     virtual Path elementPath() const;
-    RenderObject* imageMapLinkRenderer() const;
+    RenderElement* imageMapLinkRenderer() const;
     virtual void accessibilityText(Vector<AccessibilityText>&);
     virtual bool isImageMapLink() const { return true; }
     virtual bool supportsPath() const { return true; }
index 2e4183cdcb6f41de9d100b9365da4d6fe118c4df..8af3e2f01b07b173f80a7082b5747d7fff395308 100644 (file)
@@ -1262,7 +1262,7 @@ bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
             
             // check whether rendered image was stretched from one-dimensional file image
             if (image->cachedImage()) {
-                LayoutSize imageSize = image->cachedImage()->imageSizeForRenderer(m_renderer, image->view().zoomFactor());
+                LayoutSize imageSize = image->cachedImage()->imageSizeForRenderer(toRenderElement(m_renderer), image->view().zoomFactor());
                 return imageSize.height() <= 1 || imageSize.width() <= 1;
             }
         }
index 4ffe861a77d2cd20f7c343857b73564f73590f47..c02ef9f508f1dd9bc1c4834c63749aa769197079 100644 (file)
@@ -366,10 +366,10 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
     WebCore::RenderObject* renderer = core(self)->renderer();
     if (!renderer || !renderer->isImage())
         return nil;
-    WebCore::CachedImage* cachedImage = static_cast<WebCore::RenderImage*>(renderer)->cachedImage();
+    WebCore::CachedImage* cachedImage = toRenderImage(renderer)->cachedImage();
     if (!cachedImage || cachedImage->errorOccurred())
         return nil;
-    return cachedImage->imageForRenderer(renderer)->getNSImage();
+    return cachedImage->imageForRenderer(toRenderImage(renderer))->getNSImage();
 }
 
 @end
@@ -379,7 +379,7 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
 - (NSFont *)_font
 {
     // FIXME: Could we move this function to WebCore::Element and autogenerate?
-    WebCore::RenderObject* renderer = core(self)->renderer();
+    auto renderer = core(self)->renderer();
     if (!renderer)
         return nil;
     return renderer->style()->font().primaryFont()->getNSFont();
@@ -388,7 +388,7 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
 - (NSData *)_imageTIFFRepresentation
 {
     // FIXME: Could we move this function to WebCore::Element and autogenerate?
-    WebCore::RenderObject* renderer = core(self)->renderer();
+    auto renderer = core(self)->renderer();
     if (!renderer || !renderer->isImage())
         return nil;
     WebCore::CachedImage* cachedImage = static_cast<WebCore::RenderImage*>(renderer)->cachedImage();
index 1fe2a350f1d2f9098d5694255f4f0314741b5d7b..48f83335ec40566f9e21f0b1b773525a12e73f0b 100644 (file)
@@ -27,7 +27,7 @@
 #include "CSSCanvasValue.h"
 
 #include "ImageBuffer.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
@@ -50,25 +50,23 @@ String CSSCanvasValue::customCSSText() const
 void CSSCanvasValue::canvasChanged(HTMLCanvasElement*, const FloatRect& changedRect)
 {
     IntRect imageChangeRect = enclosingIntRect(changedRect);
-    HashCountedSet<RenderObject*>::const_iterator end = clients().end();
-    for (HashCountedSet<RenderObject*>::const_iterator curr = clients().begin(); curr != end; ++curr)
-        const_cast<RenderObject*>(curr->key)->imageChanged(static_cast<WrappedImagePtr>(this), &imageChangeRect);
+    for (auto it = clients().begin(), end = clients().end(); it != end; ++it)
+        it->key->imageChanged(static_cast<WrappedImagePtr>(this), &imageChangeRect);
 }
 
 void CSSCanvasValue::canvasResized(HTMLCanvasElement*)
 {
-    HashCountedSet<RenderObject*>::const_iterator end = clients().end();
-    for (HashCountedSet<RenderObject*>::const_iterator curr = clients().begin(); curr != end; ++curr)
-        const_cast<RenderObject*>(curr->key)->imageChanged(static_cast<WrappedImagePtr>(this));
+    for (auto it = clients().begin(), end = clients().end(); it != end; ++it)
+        it->key->imageChanged(static_cast<WrappedImagePtr>(this));
 }
 
 void CSSCanvasValue::canvasDestroyed(HTMLCanvasElement* element)
 {
     ASSERT_UNUSED(element, element == m_element);
-    m_element = 0;
+    m_element = nullptr;
 }
 
-IntSize CSSCanvasValue::fixedSize(const RenderObject* renderer)
+IntSize CSSCanvasValue::fixedSize(const RenderElement* renderer)
 {
     if (HTMLCanvasElement* elt = element(renderer->document()))
         return IntSize(elt->width(), elt->height());
@@ -86,13 +84,13 @@ HTMLCanvasElement* CSSCanvasValue::element(Document& document)
     return m_element;
 }
 
-PassRefPtr<Image> CSSCanvasValue::image(RenderObject* renderer, const IntSize& /*size*/)
+PassRefPtr<Image> CSSCanvasValue::image(RenderElement* renderer, const IntSize& /*size*/)
 {
     ASSERT(clients().contains(renderer));
-    HTMLCanvasElement* elt = element(renderer->document());
-    if (!elt || !elt->buffer())
+    HTMLCanvasElement* element = this->element(renderer->document());
+    if (!element || !element->buffer())
         return 0;
-    return elt->copiedImage();
+    return element->copiedImage();
 }
 
 bool CSSCanvasValue::equals(const CSSCanvasValue& other) const
index 333b33041c3c99fe371cd7c08496303e66eebb29..5f8ecadc27bd9b79e274b3dd684d2a7c8b482efb 100644 (file)
@@ -40,9 +40,9 @@ public:
 
     String customCSSText() const;
 
-    PassRefPtr<Image> image(RenderObject*, const IntSize&);
+    PassRefPtr<Image> image(RenderElement*, const IntSize&);
     bool isFixedSize() const { return true; }
-    IntSize fixedSize(const RenderObject*);
+    IntSize fixedSize(const RenderElement*);
 
     bool isPending() const { return false; }
     void loadSubimages(CachedResourceLoader*) { }
index 4e6ee1ad6cbd606768dcbd56f51e23a9e92b64cd..572aa049b50ba121e275c57ffae6a93f2bf6f328 100644 (file)
@@ -1696,7 +1696,7 @@ static inline PassRefPtr<RenderStyle> computeRenderStyleForProperty(Node* styled
 
     if (renderer && renderer->isComposited() && AnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
         AnimationUpdateBlock animationUpdateBlock(&renderer->animation());
-        RefPtr<RenderStyle> style = renderer->animation().getAnimatedStyleForRenderer(renderer);
+        RefPtr<RenderStyle> style = renderer->animation().getAnimatedStyleForRenderer(toRenderElement(renderer));
         if (pseudoElementSpecifier && !styledNode->isPseudoElement()) {
             // FIXME: This cached pseudo style will only exist if the animation has been run at least once.
             return style->getCachedPseudoStyle(pseudoElementSpecifier);
index 1a3316b327f690bfbc62af1327cf4f17f87a5e16..c944b6787044c08a059bc9c9b94b2d9acd98bfb0 100644 (file)
@@ -32,7 +32,7 @@
 #include "CachedResourceLoader.h"
 #include "CrossfadeGeneratedImage.h"
 #include "ImageBuffer.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include "StyleCachedImage.h"
 #include "StyleGeneratedImage.h"
 #include <wtf/text/StringBuilder.h>
@@ -44,7 +44,7 @@ static inline double blendFunc(double from, double to, double progress)
     return blend(from, to, progress);
 }
 
-static bool subimageKnownToBeOpaque(CSSValue* value, const RenderObject* renderer)
+static bool subimageKnownToBeOpaque(CSSValue* value, const RenderElement* renderer)
 {
     if (value->isImageValue())
         return toCSSImageValue(value)->knownToBeOpaque(renderer);
@@ -78,7 +78,7 @@ String CSSCrossfadeValue::customCSSText() const
     return result.toString();
 }
 
-IntSize CSSCrossfadeValue::fixedSize(const RenderObject* renderer)
+IntSize CSSCrossfadeValue::fixedSize(const RenderElement* renderer)
 {
     float percentage = m_percentageValue->getFloatValue();
     float inversePercentage = 1 - percentage;
@@ -108,7 +108,7 @@ bool CSSCrossfadeValue::isPending() const
         || CSSImageGeneratorValue::subimageIsPending(m_toValue.get());
 }
 
-bool CSSCrossfadeValue::knownToBeOpaque(const RenderObject* renderer) const
+bool CSSCrossfadeValue::knownToBeOpaque(const RenderElement* renderer) const
 {
     return subimageKnownToBeOpaque(m_fromValue.get(), renderer) && subimageKnownToBeOpaque(m_toValue.get(), renderer);
 }
@@ -138,7 +138,7 @@ void CSSCrossfadeValue::loadSubimages(CachedResourceLoader* cachedResourceLoader
     m_crossfadeSubimageObserver.setReady(true);
 }
 
-PassRefPtr<Image> CSSCrossfadeValue::image(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Image> CSSCrossfadeValue::image(RenderElement* renderer, const IntSize& size)
 {
     if (size.isEmpty())
         return 0;
@@ -163,11 +163,8 @@ PassRefPtr<Image> CSSCrossfadeValue::image(RenderObject* renderer, const IntSize
 
 void CSSCrossfadeValue::crossfadeChanged(const IntRect&)
 {
-    HashCountedSet<RenderObject*>::const_iterator end = clients().end();
-    for (HashCountedSet<RenderObject*>::const_iterator curr = clients().begin(); curr != end; ++curr) {
-        RenderObject* client = const_cast<RenderObject*>(curr->key);
-        client->imageChanged(static_cast<WrappedImagePtr>(this));
-    }
+    for (auto it = clients().begin(), end = clients().end(); it != end; ++it)
+        it->key->imageChanged(static_cast<WrappedImagePtr>(this));
 }
 
 void CSSCrossfadeValue::CrossfadeSubimageObserverProxy::imageChanged(CachedImage*, const IntRect* rect)
index f9dbbac19d38a2eaaca3306eb922e117e88606ae..964b116e92b45982a151188ced8da56d778a63f9 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 class CachedImage;
 class CrossfadeSubimageObserverProxy;
-class RenderObject;
+class RenderElement;
 class Document;
 
 class CSSCrossfadeValue : public CSSImageGeneratorValue {
@@ -52,12 +52,12 @@ public:
 
     String customCSSText() const;
 
-    PassRefPtr<Image> image(RenderObject*, const IntSize&);
+    PassRefPtr<Image> image(RenderElement*, const IntSize&);
     bool isFixedSize() const { return true; }
-    IntSize fixedSize(const RenderObject*);
+    IntSize fixedSize(const RenderElement*);
 
     bool isPending() const;
-    bool knownToBeOpaque(const RenderObject*) const;
+    bool knownToBeOpaque(const RenderElement*) const;
 
     void loadSubimages(CachedResourceLoader*);
 
index 57d2ebff393743ddef6ffa1eccee7025cf496cac..f7495d973391ac9f5dee65de6372b083a4953eb1 100644 (file)
@@ -34,7 +34,7 @@
 #include "CrossfadeGeneratedImage.h"
 #include "FilterEffectRenderer.h"
 #include "ImageBuffer.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include "StyleCachedImage.h"
 #include "StyleGeneratedImage.h"
 #include "StyleResolver.h"
@@ -59,7 +59,7 @@ String CSSFilterImageValue::customCSSText() const
     return result.toString();
 }
 
-IntSize CSSFilterImageValue::fixedSize(const RenderObject* renderer)
+IntSize CSSFilterImageValue::fixedSize(const RenderElement* renderer)
 {
     CachedResourceLoader* cachedResourceLoader = renderer->document().cachedResourceLoader();
     CachedImage* cachedImage = cachedImageForCSSValue(m_imageValue.get(), cachedResourceLoader);
@@ -75,7 +75,7 @@ bool CSSFilterImageValue::isPending() const
     return CSSImageGeneratorValue::subimageIsPending(m_imageValue.get());
 }
 
-bool CSSFilterImageValue::knownToBeOpaque(const RenderObject*) const
+bool CSSFilterImageValue::knownToBeOpaque(const RenderElement*) const
 {
     return false;
 }
@@ -96,7 +96,7 @@ void CSSFilterImageValue::loadSubimages(CachedResourceLoader* cachedResourceLoad
     m_filterSubimageObserver.setReady(true);
 }
 
-PassRefPtr<Image> CSSFilterImageValue::image(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Image> CSSFilterImageValue::image(RenderElement* renderer, const IntSize& size)
 {
     if (size.isEmpty())
         return 0;
@@ -133,11 +133,8 @@ PassRefPtr<Image> CSSFilterImageValue::image(RenderObject* renderer, const IntSi
 
 void CSSFilterImageValue::filterImageChanged(const IntRect&)
 {
-    HashCountedSet<RenderObject*>::const_iterator end = clients().end();
-    for (HashCountedSet<RenderObject*>::const_iterator curr = clients().begin(); curr != end; ++curr) {
-        RenderObject* client = const_cast<RenderObject*>(curr->key);
-        client->imageChanged(static_cast<WrappedImagePtr>(this));
-    }
+    for (auto it = clients().begin(), end = clients().end(); it != end; ++it)
+        it->key->imageChanged(static_cast<WrappedImagePtr>(this));
 }
 
 void CSSFilterImageValue::createFilterOperations(StyleResolver* resolver)
index 9a5bf0ed6383239cceb816ab15e9a56aeb44be93..1c2cb5f126fab2a847f2aec277e6e9c0a4b8d537 100644 (file)
@@ -41,7 +41,7 @@ namespace WebCore {
 
 class CachedImage;
 class FilterSubimageObserverProxy;
-class RenderObject;
+class RenderElement;
 class Document;
 class StyleResolver;
 
@@ -57,12 +57,12 @@ public:
 
     String customCSSText() const;
 
-    PassRefPtr<Image> image(RenderObject*, const IntSize&);
+    PassRefPtr<Image> image(RenderElement*, const IntSize&);
     bool isFixedSize() const { return true; }
-    IntSize fixedSize(const RenderObject*);
+    IntSize fixedSize(const RenderElement*);
 
     bool isPending() const;
-    bool knownToBeOpaque(const RenderObject*) const;
+    bool knownToBeOpaque(const RenderElement*) const;
 
     void loadSubimages(CachedResourceLoader*);
 
index 82cc50711c7a80a3ce434089bf3e1610a6c07f00..12ff58e4182b34725d8145d827df9be97dcf4ba4 100644 (file)
@@ -43,7 +43,6 @@
 #include "FontCache.h"
 #include "Frame.h"
 #include "FrameLoader.h"
-#include "RenderObject.h"
 #include "Settings.h"
 #include "SimpleFontData.h"
 #include "StylePropertySet.h"
index 03ac19b49870bc77cbcdcbe3dff04a9889b4a1de..2f135107523e4e12ab140aa0227859baab0c0eb2 100644 (file)
@@ -43,7 +43,7 @@ using namespace std;
 
 namespace WebCore {
 
-PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Image> CSSGradientValue::image(RenderElement* renderer, const IntSize& size)
 {
     if (size.isEmpty())
         return 0;
@@ -132,7 +132,7 @@ PassRefPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(StyleR
     return result.release();
 }
 
-void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, RenderStyle* rootStyle, float maxLengthForRepeat)
+void CSSGradientValue::addStops(Gradient* gradient, RenderElement* renderer, RenderStyle* rootStyle, float maxLengthForRepeat)
 {
     RenderStyle* style = renderer->style();
 
@@ -459,7 +459,7 @@ bool CSSGradientValue::isCacheable() const
     return true;
 }
 
-bool CSSGradientValue::knownToBeOpaque(const RenderObject*) const
+bool CSSGradientValue::knownToBeOpaque(const RenderElement*) const
 {
     for (size_t i = 0; i < m_stops.size(); ++i) {
         if (m_stops[i].m_resolvedColor.hasAlpha())
@@ -643,7 +643,7 @@ static void endPointsFromAngle(float angleDeg, const IntSize& size, FloatPoint&
     firstPoint.set(halfWidth - endX, halfHeight + endY);
 }
 
-PassRefPtr<Gradient> CSSLinearGradientValue::createGradient(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Gradient> CSSLinearGradientValue::createGradient(RenderElement* renderer, const IntSize& size)
 {
     ASSERT(!size.isEmpty());
 
@@ -983,7 +983,7 @@ static inline float horizontalEllipseRadius(const FloatSize& p, float aspectRati
 }
 
 // FIXME: share code with the linear version
-PassRefPtr<Gradient> CSSRadialGradientValue::createGradient(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Gradient> CSSRadialGradientValue::createGradient(RenderElement* renderer, const IntSize& size)
 {
     ASSERT(!size.isEmpty());
 
index 3f1ec0480d76d713adeb0a8c82fd52b3977ec9d8..962d8dd3f6e855b4999581795d89c222c5c43a66 100644 (file)
@@ -61,7 +61,7 @@ struct CSSGradientColorStop {
 
 class CSSGradientValue : public CSSImageGeneratorValue {
 public:
-    PassRefPtr<Image> image(RenderObject*, const IntSize&);
+    PassRefPtr<Image> image(RenderElement*, const IntSize&);
 
     void setFirstX(PassRefPtr<CSSPrimitiveValue> val) { m_firstX = val; }
     void setFirstY(PassRefPtr<CSSPrimitiveValue> val) { m_firstY = val; }
@@ -82,10 +82,10 @@ public:
     CSSGradientType gradientType() const { return m_gradientType; }
 
     bool isFixedSize() const { return false; }
-    IntSize fixedSize(const RenderObject*) const { return IntSize(); }
+    IntSize fixedSize(const RenderElement*) const { return IntSize(); }
 
     bool isPending() const { return false; }
-    bool knownToBeOpaque(const RenderObject*) const;
+    bool knownToBeOpaque(const RenderElement*) const;
 
     void loadSubimages(CachedResourceLoader*) { }
     PassRefPtr<CSSGradientValue> gradientWithStylesResolved(StyleResolver*);
@@ -112,7 +112,7 @@ protected:
     {
     }
 
-    void addStops(Gradient*, RenderObject*, RenderStyle* rootStyle, float maxLengthForRepeat = 0);
+    void addStops(Gradient*, RenderElement*, RenderStyle* rootStyle, float maxLengthForRepeat = 0);
 
     // Resolve points/radii to front end values.
     FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, const IntSize&);
@@ -147,7 +147,7 @@ public:
     String customCSSText() const;
 
     // Create the gradient for a given size.
-    PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
+    PassRefPtr<Gradient> createGradient(RenderElement*, const IntSize&);
 
     PassRefPtr<CSSLinearGradientValue> clone() const
     {
@@ -195,7 +195,7 @@ public:
     void setEndVerticalSize(PassRefPtr<CSSPrimitiveValue> val) { m_endVerticalSize = val; }
 
     // Create the gradient for a given size.
-    PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
+    PassRefPtr<Gradient> createGradient(RenderElement*, const IntSize&);
 
     bool equals(const CSSRadialGradientValue&) const;
 
index a905f235fcbcb32a946d2288eba865d846e8066f..101575da0d9f5e1cc356255d6af44eb3d2da07c9 100644 (file)
@@ -33,7 +33,7 @@
 #include "CSSGradientValue.h"
 #include "CSSImageValue.h"
 #include "Image.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include "StyleCachedImage.h"
 #include <wtf/text/WTFString.h>
 
@@ -50,14 +50,14 @@ CSSImageGeneratorValue::~CSSImageGeneratorValue()
 {
 }
 
-void CSSImageGeneratorValue::addClient(RenderObject* renderer)
+void CSSImageGeneratorValue::addClient(RenderElement* renderer)
 {
     ASSERT(renderer);
     ref();
     m_clients.add(renderer);
 }
 
-void CSSImageGeneratorValue::removeClient(RenderObject* renderer)
+void CSSImageGeneratorValue::removeClient(RenderElement* renderer)
 {
     ASSERT(renderer);
     m_clients.remove(renderer);
@@ -104,7 +104,7 @@ void CSSImageGeneratorValue::CachedGeneratedImage::evictionTimerFired(Deferrable
     m_owner.evictCachedGeneratedImage(m_size);
 }
 
-PassRefPtr<Image> CSSImageGeneratorValue::image(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Image> CSSImageGeneratorValue::image(RenderElement* renderer, const IntSize& size)
 {
     switch (classType()) {
     case CanvasClass:
@@ -146,7 +146,7 @@ bool CSSImageGeneratorValue::isFixedSize() const
     return false;
 }
 
-IntSize CSSImageGeneratorValue::fixedSize(const RenderObject* renderer)
+IntSize CSSImageGeneratorValue::fixedSize(const RenderElement* renderer)
 {
     switch (classType()) {
     case CanvasClass:
@@ -188,7 +188,7 @@ bool CSSImageGeneratorValue::isPending() const
     return false;
 }
 
-bool CSSImageGeneratorValue::knownToBeOpaque(const RenderObject* renderer) const
+bool CSSImageGeneratorValue::knownToBeOpaque(const RenderElement* renderer) const
 {
     switch (classType()) {
     case CrossfadeClass:
index 68e8a827dae0b9e47fe00a2c1885f14e3ffd877f..21419fac2e71d4ad01b4ad3c050e1ef4bacc238a 100644 (file)
@@ -38,23 +38,23 @@ namespace WebCore {
 
 class CachedResourceLoader;
 class GeneratedImage;
-class RenderObject;
+class RenderElement;
 class StyleResolver;
 
 class CSSImageGeneratorValue : public CSSValue {
 public:
     ~CSSImageGeneratorValue();
 
-    void addClient(RenderObject*);
-    void removeClient(RenderObject*);
+    void addClient(RenderElement*);
+    void removeClient(RenderElement*);
 
-    PassRefPtr<Image> image(RenderObject*, const IntSize&);
+    PassRefPtr<Image> image(RenderElement*, const IntSize&);
 
     bool isFixedSize() const;
-    IntSize fixedSize(const RenderObject*);
+    IntSize fixedSize(const RenderElement*);
 
     bool isPending() const;
-    bool knownToBeOpaque(const RenderObject*) const;
+    bool knownToBeOpaque(const RenderElement*) const;
 
     void loadSubimages(CachedResourceLoader*);
 
@@ -63,7 +63,7 @@ protected:
 
     GeneratedImage* cachedImageForSize(IntSize);
     void saveCachedImageForSize(IntSize, PassRefPtr<GeneratedImage>);
-    const HashCountedSet<RenderObject*>& clients() const { return m_clients; }
+    const HashCountedSet<RenderElement*>& clients() const { return m_clients; }
 
     // Helper functions for Crossfade and Filter.
     static CachedImage* cachedImageForCSSValue(CSSValue*, CachedResourceLoader*);
@@ -88,7 +88,7 @@ private:
     friend class CachedGeneratedImage;
     void evictCachedGeneratedImage(IntSize);
 
-    HashCountedSet<RenderObject*> m_clients;
+    HashCountedSet<RenderElement*> m_clients;
     HashMap<IntSize, OwnPtr<CachedGeneratedImage> > m_images;
 };
 
index fc2368dba0d140e3e308faaddb4eac662cf7b8ec..b9deb6c1ba0ae0b7d787b957d94a03efa0bf9f83 100644 (file)
@@ -115,7 +115,7 @@ PassRefPtr<CSSValue> CSSImageValue::cloneForCSSOM() const
     return uriValue.release();
 }
 
-bool CSSImageValue::knownToBeOpaque(const RenderObject* renderer) const
+bool CSSImageValue::knownToBeOpaque(const RenderElement* renderer) const
 {
     return m_image ? m_image->knownToBeOpaque(renderer) : false;
 }
index 99b0c6cc3e7085634850da9f37a22d32970ba909..5db204301e6afac2ca9b28c5cdf0a9b35777b4e8 100644 (file)
@@ -30,7 +30,7 @@ class CachedResourceLoader;
 class Element;
 class StyleCachedImage;
 class StyleImage;
-class RenderObject;
+class RenderElement;
 struct ResourceLoaderOptions;
 
 class CSSImageValue : public CSSValue {
@@ -54,7 +54,7 @@ public:
 
     bool equals(const CSSImageValue&) const;
 
-    bool knownToBeOpaque(const RenderObject*) const;
+    bool knownToBeOpaque(const RenderElement*) const;
 
     void setInitiator(const AtomicString& name) { m_initiatorName = name; }
 
index b2a0fa74679dcad8b50b253052a5f3c67b84007b..5c887f79feec1282cebb40be098bdc7e74707e44 100644 (file)
@@ -42,7 +42,6 @@
 #include "Frame.h"
 #include "Pair.h"
 #include "Rect.h"
-#include "RenderObject.h"
 #include "RenderStyle.h"
 #include "RenderView.h"
 #include "Settings.h"
index 41ff8f83f0661e7f2e32239e14b4629dc3871621..38e7b94d94660c0999557e0599763290dc976129 100644 (file)
@@ -33,6 +33,7 @@
 namespace WebCore {
 
 class FloatPoint;
+class RenderElement;
 
 typedef void (*NodeCallback)(Node*, unsigned);
 
@@ -126,6 +127,8 @@ public:
     using Node::setAttributeEventListener;
     void setAttributeEventListener(const AtomicString& eventType, const QualifiedName& attributeName, const AtomicString& value);
 
+    RenderElement* renderer() const;
+
 protected:
     explicit ContainerNode(Document*, ConstructionType = CreateContainer);
 
index 1f073b575c2be1eb63235ded7145b8b099050137..5f98aceda4062fa8abefd6af7b2f76f0c6300c36 100644 (file)
@@ -454,7 +454,7 @@ void DocumentMarkerController::removeMarkersFromList(MarkerMap::iterator iterato
     }
 
     if (needsRepainting) {
-        if (RenderObject* renderer = iterator->key->renderer())
+        if (auto renderer = iterator->key->renderer())
             renderer->repaint();
     }
 
@@ -493,7 +493,7 @@ void DocumentMarkerController::repaintMarkers(DocumentMarker::MarkerTypes marker
             continue;
 
         // cause the node to be redrawn
-        if (RenderObject* renderer = node->renderer())
+        if (auto renderer = node->renderer())
             renderer->repaint();
     }
 }
index 3bdfb3cd43f716f305cb33505c1293529f039e31..5b3964789e8fbbe6c60d55e40113a51e21b5de87 100644 (file)
@@ -603,17 +603,17 @@ void Element::scrollByPages(int pages)
     scrollByUnits(pages, ScrollByPage);
 }
 
-static float localZoomForRenderer(RenderObject* renderer)
+static float localZoomForRenderer(RenderElement* renderer)
 {
     // FIXME: This does the wrong thing if two opposing zooms are in effect and canceled each
     // other out, but the alternative is that we'd have to crawl up the whole render tree every
     // time (or store an additional bit in the RenderStyle to indicate that a zoom was specified).
     float zoomFactor = 1;
     if (renderer->style()->effectiveZoom() != 1) {
-        // Need to find the nearest enclosing RenderObject that set up
+        // Need to find the nearest enclosing RenderElement that set up
         // a differing zoom, and then we divide our result by it to eliminate the zoom.
-        RenderObject* prev = renderer;
-        for (RenderObject* curr = prev->parent(); curr; curr = curr->parent()) {
+        RenderElement* prev = renderer;
+        for (RenderElement* curr = prev->parent(); curr; curr = curr->parent()) {
             if (curr->style()->effectiveZoom() != prev->style()->effectiveZoom()) {
                 zoomFactor = prev->style()->zoom();
                 break;
@@ -626,7 +626,7 @@ static float localZoomForRenderer(RenderObject* renderer)
     return zoomFactor;
 }
 
-static int adjustForLocalZoom(LayoutUnit value, RenderObject* renderer)
+static int adjustForLocalZoom(LayoutUnit value, RenderElement* renderer)
 {
     float zoomFactor = localZoomForRenderer(renderer);
     if (zoomFactor == 1)
@@ -692,11 +692,13 @@ Element* Element::bindingsOffsetParent()
 Element* Element::offsetParent()
 {
     document().updateLayoutIgnorePendingStylesheets();
-    if (RenderObject* renderer = this->renderer()) {
-        if (RenderObject* offsetParent = renderer->offsetParent())
-            return toElement(offsetParent->node());
-    }
-    return 0;
+    auto renderer = this->renderer();
+    if (!renderer)
+        return nullptr;
+    auto offsetParent = renderer->offsetParent();
+    if (!offsetParent)
+        return nullptr;
+    return offsetParent->element();
 }
 
 int Element::clientLeft()
@@ -2350,7 +2352,7 @@ bool Element::updateExistingPseudoElement(PseudoElement* existingPseudoElement,
     // FIXME: This is silly.
     // Wait until our parent is not displayed or pseudoElementRendererIsNeeded
     // is false, otherwise we could continously create and destroy PseudoElements
-    // when RenderObject::isChildAllowed on our parent returns false for the
+    // when RenderElement::isChildAllowed on our parent returns false for the
     // PseudoElement's renderer for each style recalc.
     return renderer() && pseudoElementRendererIsNeeded(existingPseudoElement->renderStyle());
 }
index 3426ad956d58b84375ca63672d1382d84abc7825..c91b35c18f802c56215857a1c21951453b21f21c 100644 (file)
@@ -45,7 +45,6 @@ class IntSize;
 class Locale;
 class PlatformWheelEvent;
 class PseudoElement;
-class RenderElement;
 class RenderRegion;
 class ShadowRoot;
 
@@ -129,8 +128,6 @@ public:
     DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenerror);
 #endif
 
-    RenderElement* renderer() const;
-
     bool hasAttribute(const QualifiedName&) const;
     const AtomicString& getAttribute(const QualifiedName&) const;
     void setAttribute(const QualifiedName&, const AtomicString& value);
index b556867a22c023dc41080956335a8f082127a3d6..fe2a825c33dde159d6a99ec078e755b5ccbbe47f 100644 (file)
@@ -27,6 +27,7 @@
 #include "NamedNodeMap.h"
 #include "NodeRareData.h"
 #include "PseudoElement.h"
+#include "RenderElement.h"
 #include "ShadowRoot.h"
 #include "StyleInheritedData.h"
 #include <wtf/OwnPtr.h>
@@ -35,7 +36,7 @@ namespace WebCore {
 
 class ElementRareData : public NodeRareData {
 public:
-    static PassOwnPtr<ElementRareData> create(RenderObject* renderer) { return adoptPtr(new ElementRareData(renderer)); }
+    static PassOwnPtr<ElementRareData> create(RenderElement* renderer) { return adoptPtr(new ElementRareData(renderer)); }
 
     ~ElementRareData();
 
@@ -166,7 +167,7 @@ private:
     RefPtr<PseudoElement> m_beforePseudoElement;
     RefPtr<PseudoElement> m_afterPseudoElement;
 
-    explicit ElementRareData(RenderObject*);
+    explicit ElementRareData(RenderElement*);
     void releasePseudoElement(PseudoElement*);
 };
 
@@ -175,7 +176,7 @@ inline IntSize defaultMinimumSizeForResizing()
     return IntSize(LayoutUnit::max(), LayoutUnit::max());
 }
 
-inline ElementRareData::ElementRareData(RenderObject* renderer)
+inline ElementRareData::ElementRareData(RenderElement* renderer)
     : NodeRareData(renderer)
     , m_tabIndex(0)
     , m_childIndex(0)
index aa2196e5436be7378a8efd0f1a35ffe97bec1700..616c57c24fdd3d3e16d51d5311e892cd4314349b 100644 (file)
@@ -386,7 +386,7 @@ NodeRareData& Node::ensureRareData()
 
     NodeRareData* data;
     if (isElementNode())
-        data = ElementRareData::create(m_data.m_renderer).leakPtr();
+        data = ElementRareData::create(toRenderElement(m_data.m_renderer)).leakPtr();
     else
         data = NodeRareData::create(m_data.m_renderer).leakPtr();
     ASSERT(data);
@@ -2192,7 +2192,7 @@ void Node::defaultEventHandler(Event* event)
 
             if (renderer) {
                 if (Frame* frame = document().frame())
-                    frame->eventHandler().startPanScrolling(renderer);
+                    frame->eventHandler().startPanScrolling(toRenderBox(renderer));
             }
         }
 #endif
index 94610a2c2b98bf691c6d98496906e149a867783c..60dc9d7e6124eb7add0e7e1b1e36bf61b4eb18ee 100644 (file)
@@ -102,24 +102,24 @@ static bool isDeletableElement(const Node* node)
     if ((borderBoundingBox.width() * borderBoundingBox.height()) < minimumArea)
         return false;
 
-    if (renderer->isTable())
+    if (box->isTable())
         return true;
 
     if (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(iframeTag))
         return true;
 
-    if (renderer->isOutOfFlowPositioned())
+    if (box->isOutOfFlowPositioned())
         return true;
 
-    if (renderer->isRenderBlock() && !renderer->isTableCell()) {
-        RenderStyle* style = renderer->style();
+    if (box->isRenderBlock() && !box->isTableCell()) {
+        RenderStyle* style = box->style();
         if (!style)
             return false;
 
         // Allow blocks that have background images
         if (style->hasBackgroundImage()) {
             for (const FillLayer* background = style->backgroundLayers(); background; background = background->next()) {
-                if (background->image() && background->image()->canRender(renderer, 1))
+                if (background->image() && background->image()->canRender(box, 1))
                     return true;
             }
         }
@@ -142,7 +142,7 @@ static bool isDeletableElement(const Node* node)
         if (!parentStyle)
             return false;
 
-        if (renderer->hasBackground() && (!parentRenderer->hasBackground() || style->visitedDependentColor(CSSPropertyBackgroundColor) != parentStyle->visitedDependentColor(CSSPropertyBackgroundColor)))
+        if (box->hasBackground() && (!parentRenderer->hasBackground() || style->visitedDependentColor(CSSPropertyBackgroundColor) != parentStyle->visitedDependentColor(CSSPropertyBackgroundColor)))
             return true;
     }
 
index 35b301fe5978cdc4f3f1f937aa6b707482d6b883..197a1e699c97d80d461fe0d6af5c643a3a80ce01 100644 (file)
@@ -580,7 +580,7 @@ bool Editor::hasBidiSelection() const
     } else
         startNode = m_frame.selection().selection().visibleStart().deepEquivalent().deprecatedNode();
 
-    RenderObject* renderer = startNode->renderer();
+    auto renderer = startNode->renderer();
     while (renderer && !renderer->isRenderBlock())
         renderer = renderer->parent();
 
@@ -1438,7 +1438,7 @@ WritingDirection Editor::baseWritingDirectionForSelectionStart() const
     if (!node)
         return result;
 
-    RenderObject* renderer = node->renderer();
+    auto renderer = node->renderer();
     if (!renderer)
         return result;
 
index 80e42a36dd4dfcbbd97427a4d5e4b90344d06227..6c0769999f5a6f72cde503b550ef640c8656a6e5 100644 (file)
@@ -253,7 +253,7 @@ static unsigned verticalScrollDistance(Frame& frame)
     Element* focusedElement = frame.document()->focusedElement();
     if (!focusedElement)
         return 0;
-    RenderObject* renderer = focusedElement->renderer();
+    auto renderer = focusedElement->renderer();
     if (!renderer || !renderer->isBox())
         return 0;
     RenderStyle* style = renderer->style();
index 8743b2410d756090d29e8ef92cf5ccece38ea2e8..b901050a9b5fa2520d07b19c9c0a8e2ed98da311 100644 (file)
@@ -326,11 +326,13 @@ Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
 
 TextDirection directionOfEnclosingBlock(const Position& position)
 {
-    Node* enclosingBlockNode = enclosingBlock(position.containerNode());
-    if (!enclosingBlockNode)
+    auto block = enclosingBlock(position.containerNode());
+    if (!block)
         return LTR;
-    RenderObject* renderer = enclosingBlockNode->renderer();
-    return renderer ? renderer->style()->direction() : LTR;
+    auto renderer = block->renderer();
+    if (!renderer)
+        return LTR;
+    return renderer->style()->direction();
 }
 
 // This method is used to create positions in the DOM. It returns the maximum valid offset
index e094f0f4132d8b070b5f598d39b10c81f3c65b7c..b95e0dba459471da0b4b08743afbd0b0ab9a01f1 100644 (file)
@@ -244,7 +244,7 @@ const SimpleFontData* Editor::fontForSelection(bool& hasMultipleFonts) const
         // In the loop below, n should eventually match pastEnd and not become nil, but we've seen at least one
         // unreproducible case where this didn't happen, so check for null also.
         for (Node* node = startNode; node && node != pastEnd; node = NodeTraversal::next(node)) {
-            RenderObject* renderer = node->renderer();
+            auto renderer = node->renderer();
             if (!renderer)
                 continue;
             // FIXME: Are there any node types that have renderers, but that we should be skipping?
@@ -344,7 +344,7 @@ void Editor::writeSelectionToPasteboard(Pasteboard& pasteboard)
 
 static void getImage(Element& imageElement, RefPtr<Image>& image, CachedImage*& cachedImage)
 {
-    RenderObject* renderer = imageElement.renderer();
+    auto renderer = imageElement.renderer();
     if (!renderer || !renderer->isImage())
         return;
 
index dd443637c9d668d2cf68100f8350cd0e0d2b28c9..71b184ccb4cc992639088312bdb8411a568d4c01 100644 (file)
@@ -159,7 +159,7 @@ const SimpleFontData* Editor::fontForSelection(bool& hasMultipleFonts) const
         // In the loop below, n should eventually match pastEnd and not become nil, but we've seen at least one
         // unreproducible case where this didn't happen, so check for null also.
         for (Node* node = startNode; node && node != pastEnd; node = NodeTraversal::next(node)) {
-            RenderObject* renderer = node->renderer();
+            auto renderer = node->renderer();
             if (!renderer)
                 continue;
             // FIXME: Are there any node types that have renderers, but that we should be skipping?
@@ -359,7 +359,7 @@ void Editor::writeSelectionToPasteboard(Pasteboard& pasteboard)
 
 static void getImage(Element& imageElement, RefPtr<Image>& image, CachedImage*& cachedImage)
 {
-    RenderObject* renderer = imageElement.renderer();
+    auto renderer = imageElement.renderer();
     if (!renderer || !renderer->isImage())
         return;
 
index 51ef3f2ec9eed20bf78038316cc421b26f164657..a743bb64661509f78953b5b098885fce3dc59cb9 100644 (file)
@@ -52,7 +52,6 @@
 #include "MarkupAccumulator.h"
 #include "Range.h"
 #include "RenderBlock.h"
-#include "RenderObject.h"
 #include "StylePropertySet.h"
 #include "TextIterator.h"
 #include "VisibleSelection.h"
index 5207f0efa7bef3e1242bc194a3fb4faab4d79fc3..db41c5b398df8b98845bcca59778cde08fd42a13 100644 (file)
@@ -94,7 +94,7 @@ bool HTMLAreaElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size
     return true;
 }
 
-Path HTMLAreaElement::computePath(RenderObject* obj) const
+Path HTMLAreaElement::computePath(RenderElement* obj) const
 {
     if (!obj)
         return Path();
@@ -119,7 +119,7 @@ Path HTMLAreaElement::computePath(RenderObject* obj) const
     return p;
 }
     
-LayoutRect HTMLAreaElement::computeRect(RenderObject* obj) const
+LayoutRect HTMLAreaElement::computeRect(RenderElement* obj) const
 {
     return enclosingLayoutRect(computePath(obj).fastBoundingRect());
 }
@@ -220,7 +220,7 @@ void HTMLAreaElement::setFocus(bool shouldBeFocused)
     if (!imageElement)
         return;
 
-    RenderObject* renderer = imageElement->renderer();
+    auto renderer = imageElement->renderer();
     if (!renderer || !renderer->isImage())
         return;
 
index 9cdbf66613b629dff36c7305382353784f5615c0..180f613064b84288142a7e92a26ee481487185e2 100644 (file)
@@ -41,8 +41,8 @@ public:
 
     bool mapMouseEvent(LayoutPoint location, const LayoutSize&, HitTestResult&);
 
-    LayoutRect computeRect(RenderObject*) const;
-    Path computePath(RenderObject*) const;
+    LayoutRect computeRect(RenderElement*) const;
+    Path computePath(RenderElement*) const;
 
     // The parent map's image.
     HTMLImageElement* imageElement() const;
index cca4f860506d826a8cfac4ee9733e75d5c5775a9..aad83ad5391f9298cf02b90e72e734941315eea0 100644 (file)
@@ -340,7 +340,7 @@ void HTMLCanvasElement::reset()
         static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height());
 #endif
 
-    if (RenderObject* renderer = this->renderer()) {
+    if (auto renderer = this->renderer()) {
         if (m_rendererIsCanvas) {
             if (oldSize != size()) {
                 toRenderHTMLCanvas(renderer)->canvasSizeChanged();
index c4ef85bd0d60e971c8a990bca063dddcc8bde282..208614ceb8ca2aca59f656cabee3f82bc37597c6 100644 (file)
@@ -466,7 +466,7 @@ void HTMLElement::setInnerText(const String& text, ExceptionCode& ec)
     // FIXME: Do we need to be able to detect preserveNewline style even when there's no renderer?
     // FIXME: Can the renderer be out of date here? Do we need to call updateStyleIfNeeded?
     // For example, for the contents of textarea elements that are display:none?
-    RenderObject* r = renderer();
+    auto r = renderer();
     if (r && r->style()->preserveNewline()) {
         if (!text.contains('\r')) {
             replaceChildrenWithText(*this, text, ec);
index 877fe26a671bc024e39ba06505eb96d9334f7366..fbbe51de5eb8742307880c26ecd865b2ed019cdc 100644 (file)
@@ -289,9 +289,7 @@ bool HTMLFormControlElement::isRequired() const
 
 static void updateFromElementCallback(Node* node, unsigned)
 {
-    ASSERT_ARG(node, node->isElementNode());
-    ASSERT_ARG(node, toElement(node)->isFormControlElement());
-    if (RenderObject* renderer = node->renderer())
+    if (auto renderer = toHTMLFormControlElement(node)->renderer())
         renderer->updateFromElement();
 }
 
index 7d7d62d467a25be8f7fd923ed966a1c2f916e31a..7dd33cc60b9bc15188a8aeb7081400b7916b87ea 100644 (file)
@@ -99,18 +99,18 @@ bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style)
     if (!m_wasDemoted)
         return HTMLElement::rendererIsNeeded(style);
 
-    ContainerNode* node = parentNode();
-    RenderObject* parentRenderer = node->renderer();
+    auto parent = parentNode();
+    auto parentRenderer = parent->renderer();
 
     if (!parentRenderer)
         return false;
 
     // FIXME: Shouldn't we also check for table caption (see |formIsTablePart| below).
-    bool parentIsTableElementPart = (parentRenderer->isTable() && isHTMLTableElement(node))
-        || (parentRenderer->isTableRow() && node->hasTagName(trTag))
-        || (parentRenderer->isTableSection() && node->hasTagName(tbodyTag))
-        || (parentRenderer->isRenderTableCol() && node->hasTagName(colTag))
-        || (parentRenderer->isTableCell() && node->hasTagName(trTag));
+    bool parentIsTableElementPart = (parentRenderer->isTable() && isHTMLTableElement(parent))
+        || (parentRenderer->isTableRow() && parent->hasTagName(trTag))
+        || (parentRenderer->isTableSection() && parent->hasTagName(tbodyTag))
+        || (parentRenderer->isRenderTableCol() && parent->hasTagName(colTag))
+        || (parentRenderer->isTableCell() && parent->hasTagName(trTag));
 
     if (!parentIsTableElementPart)
         return true;
index cae225000ef375c9774ab6753ceae7e2313571f5..950594cecef7d90150699bbd88e35030a0140ab5 100644 (file)
@@ -48,7 +48,7 @@ public:
 
     // Most subclasses use RenderWidget (either RenderEmbeddedObject or RenderIFrame)
     // except for HTMLObjectElement and HTMLEmbedElement which may return any
-    // RenderObject when using fallback content.
+    // RenderElement when using fallback content.
     RenderWidget* renderWidget() const;
 
 #if ENABLE(SVG)
index 25f5166f6f30016e72e869e60c917e47795307e9..3e9626822386561f9277ff7b28ea6fc0034584a2 100644 (file)
@@ -326,24 +326,22 @@ void HTMLImageElement::setWidth(int value)
 
 int HTMLImageElement::x() const
 {
-    RenderObject* r = renderer();
-    if (!r)
+    auto renderer = this->renderer();
+    if (!renderer)
         return 0;
 
     // FIXME: This doesn't work correctly with transforms.
-    FloatPoint absPos = r->localToAbsolute();
-    return absPos.x();
+    return renderer->localToAbsolute().x();
 }
 
 int HTMLImageElement::y() const
 {
-    RenderObject* r = renderer();
-    if (!r)
+    auto renderer = this->renderer();
+    if (!renderer)
         return 0;
 
     // FIXME: This doesn't work correctly with transforms.
-    FloatPoint absPos = r->localToAbsolute();
-    return absPos.y();
+    return renderer->localToAbsolute().y();
 }
 
 bool HTMLImageElement::complete() const
@@ -384,7 +382,7 @@ bool HTMLImageElement::isServerMap() const
 // FIXME: This is a workaround for <rdar://problem/7725158>. We should find a better place for the touchCalloutEnabled() logic.
 bool HTMLImageElement::willRespondToMouseClickEvents()
 {
-    RenderObject* renderer = this->renderer();
+    auto renderer = this->renderer();
     RenderStyle* style = renderer ? renderer->style() : nullptr;
     if (!style || style->touchCalloutEnabled())
         return true;
index ef4738881b56e68e28841b0160f0221491db5df6..f825bb15d65138af19b1d8750c3f56ad95ab3a60 100644 (file)
@@ -31,7 +31,6 @@
 #include "HTMLNames.h"
 #include "HitTestResult.h"
 #include "IntSize.h"
-#include "RenderObject.h"
 
 using namespace std;
 
index 4d64257f0fbf3c1250ab94e7824a934d29f0629f..fa554eff9fc977d2597144905d4848330df134b2 100644 (file)
@@ -4264,12 +4264,11 @@ void HTMLMediaElement::mediaVolumeDidChange()
 void HTMLMediaElement::defaultEventHandler(Event* event)
 {
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    RenderObject* r = renderer();
-    if (!r || !r->isWidget())
+    auto renderer = this->renderer();
+    if (!renderer || !renderer->isWidget())
         return;
 
-    Widget* widget = toRenderWidget(r)->widget();
-    if (widget)
+    if (Widget* widget = toRenderWidget(renderer)->widget())
         widget->handleEvent(event);
 #else
     HTMLElement::defaultEventHandler(event);
index b35e8840561fe323daebb9b4ac7fa1c1c36094fd..0e8ab274e0399504f5967a07830738254d8af257 100644 (file)
@@ -23,6 +23,7 @@
 #include "HTMLMeterElement.h"
 
 #include "Attribute.h"
+#include "ElementTraversal.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
 #include "FormDataList.h"
@@ -220,11 +221,8 @@ void HTMLMeterElement::didElementStateChange()
 RenderMeter* HTMLMeterElement::renderMeter() const
 {
     if (renderer() && renderer()->isMeter())
-        return static_cast<RenderMeter*>(renderer());
-
-    RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer();
-    ASSERT(!renderObject || renderObject->isMeter());
-    return static_cast<RenderMeter*>(renderObject);
+        return toRenderMeter(renderer());
+    return toRenderMeter(ElementTraversal::firstWithin(userAgentShadowRoot())->renderer());
 }
 
 void HTMLMeterElement::didAddUserAgentShadowRoot(ShadowRoot* root)
index 384d8669253564adbcf4cdc84579cb586b6f5d7a..48603556849871ba6d7341d924584b7f6320bdaa 100644 (file)
@@ -324,8 +324,8 @@ void HTMLOptionElement::didRecalcStyle(Style::Change)
 {
     // FIXME: This is nasty, we ask our owner select to repaint even if the new
     // style is exactly the same.
-    if (HTMLSelectElement* select = ownerSelectElement()) {
-        if (RenderObject* renderer = select->renderer())
+    if (auto select = ownerSelectElement()) {
+        if (auto renderer = select->renderer())
             renderer->repaint();
     }
 }
index 81fcb260a24b72856c12adf0a529dded2a76a1a7..36d83217795e5341fbfb15bc6d7e9fd5998dea39 100644 (file)
@@ -86,12 +86,8 @@ bool HTMLPlugInElement::willRespondToMouseClickEvents()
 {
     if (isDisabledFormControl())
         return false;
-    RenderObject* r = renderer();
-    if (!r)
-        return false;
-    if (!r->isEmbeddedObject() && !r->isWidget())
-        return false;
-    return true;
+    auto renderer = this->renderer();
+    return renderer && renderer->isWidget();
 }
 
 void HTMLPlugInElement::willDetachRenderers()
@@ -197,15 +193,18 @@ void HTMLPlugInElement::defaultEventHandler(Event* event)
 
     // FIXME: Mouse down and scroll events are passed down to plug-in via custom code in EventHandler; these code paths should be united.
 
-    RenderObject* r = renderer();
-    if (r && r->isEmbeddedObject()) {
-        if (toRenderEmbeddedObject(r)->isPluginUnavailable()) {
-            toRenderEmbeddedObject(r)->handleUnavailablePluginIndicatorEvent(event);
+    auto renderer = this->renderer();
+    if (!renderer || !renderer->isWidget())
+        return;
+
+    if (renderer->isEmbeddedObject()) {
+        if (toRenderEmbeddedObject(renderer)->isPluginUnavailable()) {
+            toRenderEmbeddedObject(renderer)->handleUnavailablePluginIndicatorEvent(event);
             return;
         }
 
-        if (r->isSnapshottedPlugIn() && displayState() < Restarting) {
-            toRenderSnapshottedPlugIn(r)->handleEvent(event);
+        if (toRenderEmbeddedObject(renderer)->isSnapshottedPlugIn() && displayState() < Restarting) {
+            toRenderSnapshottedPlugIn(renderer)->handleEvent(event);
             HTMLFrameOwnerElement::defaultEventHandler(event);
             return;
         }
@@ -214,9 +213,7 @@ void HTMLPlugInElement::defaultEventHandler(Event* event)
             return;
     }
 
-    if (!r || !r->isWidget())
-        return;
-    RefPtr<Widget> widget = toRenderWidget(r)->widget();
+    RefPtr<Widget> widget = toRenderWidget(renderer)->widget();
     if (!widget)
         return;
     widget->handleEvent(event);
@@ -225,17 +222,17 @@ void HTMLPlugInElement::defaultEventHandler(Event* event)
     HTMLFrameOwnerElement::defaultEventHandler(event);
 }
 
-bool HTMLPlugInElement::isKeyboardFocusable(KeyboardEvent* event) const
+bool HTMLPlugInElement::isKeyboardFocusable(KeyboardEvent*) const
 {
-    UNUSED_PARAM(event);
+    // FIXME: Why is this check needed?
     if (!document().page())
         return false;
 
-    const PluginViewBase* plugin = pluginWidget() && pluginWidget()->isPluginViewBase() ? static_cast<const PluginViewBase*>(pluginWidget()) : 0;
-    if (plugin)
-        return plugin->supportsKeyboardFocus();
+    Widget* widget = pluginWidget();
+    if (!widget || !widget->isPluginViewBase())
+        return false;
 
-    return false;
+    return toPluginViewBase(widget)->supportsKeyboardFocus();
 }
 
 bool HTMLPlugInElement::isPluginElement() const
index c636cd411c49caa91354c00db6de0fd3f098ee3b..9c2813ba00503f66926ebdf03942069fb38cb8cf 100644 (file)
@@ -713,7 +713,7 @@ void HTMLPlugInImageElement::subframeLoaderDidCreatePlugIn(const Widget* widget)
 
 void HTMLPlugInImageElement::defaultEventHandler(Event* event)
 {
-    RenderObject* r = renderer();
+    RenderElement* r = renderer();
     if (r && r->isEmbeddedObject()) {
         if (isPlugInImageElement() && displayState() == WaitingForSnapshot && event->isMouseEvent() && event->type() == eventNames().clickEvent) {
             MouseEvent* mouseEvent = toMouseEvent(event);
index 61dd94465203d0fc6358e6ebd3b48e80b52682b8..a6171f1a3672e38950306aa39b06d65018c14c48 100644 (file)
@@ -23,6 +23,7 @@
 #include "HTMLProgressElement.h"
 
 #include "Attribute.h"
+#include "ElementTraversal.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
 #include "HTMLDivElement.h"
@@ -74,11 +75,8 @@ bool HTMLProgressElement::childShouldCreateRenderer(const Node* child) const
 RenderProgress* HTMLProgressElement::renderProgress() const
 {
     if (renderer() && renderer()->isProgress())
-        return static_cast<RenderProgress*>(renderer());
-
-    RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer();
-    ASSERT_WITH_SECURITY_IMPLICATION(!renderObject || renderObject->isProgress());
-    return static_cast<RenderProgress*>(renderObject);
+        return toRenderProgress(renderer());
+    return toRenderProgress(ElementTraversal::firstWithin(userAgentShadowRoot())->renderer());
 }
 
 void HTMLProgressElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
index bee73fd2c26161a35adb60e587f858eda76e9c05..019c4b92f4333e9ed3c41a65643143c476b50eaf 100644 (file)
@@ -679,13 +679,13 @@ void HTMLSelectElement::scrollToSelection()
     if (usesMenuList())
         return;
 
-    if (RenderObject* renderer = this->renderer())
+    if (auto renderer = this->renderer())
         toRenderListBox(renderer)->selectionChanged();
 }
 
 void HTMLSelectElement::setOptionsChangedOnRenderer()
 {
-    if (RenderObject* renderer = this->renderer()) {
+    if (auto renderer = this->renderer()) {
         if (usesMenuList())
             toRenderMenuList(renderer)->setOptionsChanged(true);
         else
@@ -851,7 +851,7 @@ void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags)
         deselectItemsWithoutValidation(element);
 
     // For the menu list case, this is what makes the selected element appear.
-    if (RenderObject* renderer = this->renderer())
+    if (auto renderer = this->renderer())
         renderer->updateFromElement();
 
     scrollToSelection();
@@ -860,7 +860,7 @@ void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags)
         m_isProcessingUserDrivenChange = flags & UserDriven;
         if (flags & DispatchChangeEvent)
             dispatchChangeEventForMenuList();
-        if (RenderObject* renderer = this->renderer()) {
+        if (auto renderer = this->renderer()) {
             if (usesMenuList())
                 toRenderMenuList(renderer)->didSetSelectedIndex(listIndex);
             else if (renderer->isListBox())
index f35726060818d5f33e29b1e598dd73a9315824cf..dd02249c913a340e9a3943c675263d2709790715 100644 (file)
@@ -168,18 +168,16 @@ void HTMLTableCellElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) c
 
 HTMLTableCellElement* HTMLTableCellElement::cellAbove() const
 {
-    RenderObject* cellRenderer = renderer();
-    if (!cellRenderer)
-        return 0;
-    if (!cellRenderer->isTableCell())
-        return 0;
-
-    RenderTableCell* tableCellRenderer = toRenderTableCell(cellRenderer);
-    RenderTableCell* cellAboveRenderer = tableCellRenderer->table()->cellAbove(tableCellRenderer);
+    auto cellRenderer = renderer();
+    if (!cellRenderer || !cellRenderer->isTableCell())
+        return nullptr;
+
+    auto tableCellRenderer = toRenderTableCell(cellRenderer);
+    auto cellAboveRenderer = tableCellRenderer->table()->cellAbove(tableCellRenderer);
     if (!cellAboveRenderer)
-        return 0;
+        return nullptr;
 
-    return static_cast<HTMLTableCellElement*>(cellAboveRenderer->element());
+    return toHTMLTableCellElement(cellAboveRenderer->element());
 }
 
 #ifndef NDEBUG
index 113003bb0e492e8fa3223a02e83a4cb1cff63628..99184fe9fd32738879d8c4b2330408185321d302 100644 (file)
@@ -203,10 +203,9 @@ void HTMLTextFormControlElement::dispatchFormControlChangeEvent()
     setChangedSinceLastFormControlChangeEvent(false);
 }
 
-static inline bool hasVisibleTextArea(RenderObject* textControl, HTMLElement* innerText)
+static inline bool hasVisibleTextArea(RenderElement& textControl, HTMLElement* innerText)
 {
-    ASSERT(textControl);
-    return textControl->style()->visibility() != HIDDEN && innerText && innerText->renderer() && innerText->renderBox()->height();
+    return textControl.style()->visibility() != HIDDEN && innerText && innerText->renderer() && innerText->renderBox()->height();
 }
 
 void HTMLTextFormControlElement::setRangeText(const String& replacement, ExceptionCode& ec)
@@ -289,7 +288,7 @@ void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField
     end = max(end, 0);
     start = min(max(start, 0), end);
 
-    if (!hasVisibleTextArea(renderer(), innerTextElement())) {
+    if (!hasVisibleTextArea(*renderer(), innerTextElement())) {
         cacheSelection(start, end, direction);
         return;
     }
index 37e6da2fc1cdfcf45f789bced12fe9d12dd4c0a0..2b2462aaacc17e1d0a4de9651c6cec018e29c0a2 100644 (file)
@@ -59,7 +59,6 @@ class KeyboardEvent;
 class MouseEvent;
 class Node;
 class RenderArena;
-class RenderObject;
 class RenderStyle;
 class TouchEvent;
 
index b1009978a61ae23ab60100acbf6b4a5a12894d6d..bf4346a4a43e9343b059aaace1dcdc1f00a638fd 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "MediaList.h"
 #include "MediaQueryEvaluator.h"
-#include "RenderObject.h"
 #include "RenderView.h"
 
 namespace WebCore {
index 816ae302256bc27b003ea288798c99dc0166b914..66938f9cc083668497dde24220c08a9fddf917ad 100644 (file)
@@ -105,7 +105,7 @@ void MediaControlElement::setDisplayType(MediaControlElementType displayType)
         return;
 
     m_displayType = displayType;
-    if (RenderObject* object = m_element->renderer())
+    if (auto object = m_element->renderer())
         object->repaint();
 }
 
index 8ef6a8569eadfe4aee858ed8318f8899a544c47e..9416141965997052baf95784916708cea4687957 100644 (file)
@@ -100,7 +100,7 @@ void MediaControlPanelElement::startDrag(const LayoutPoint& eventLocation)
     if (m_isBeingDragged)
         return;
 
-    RenderObject* renderer = this->renderer();
+    auto renderer = this->renderer();
     if (!renderer || !renderer->isBox())
         return;
 
@@ -1396,20 +1396,20 @@ void MediaControlTextTrackContainerElement::updateSizes(bool forceUpdate)
 PassRefPtr<Image> MediaControlTextTrackContainerElement::createTextTrackRepresentationImage()
 {
     if (!hasChildNodes())
-        return 0;
+        return nullptr;
 
     Frame* frame = document().frame();
     if (!frame)
-        return 0;
+        return nullptr;
 
     document().updateLayout();
 
-    RenderObject* renderer = this->renderer();
+    auto renderer = this->renderer();
     if (!renderer)
-        return 0;
+        return nullptr;
 
     if (!renderer->hasLayer())
-        return 0;
+        return nullptr;
 
     RenderLayer* layer = toRenderLayerModelObject(renderer)->layer();
 
@@ -1418,9 +1418,10 @@ PassRefPtr<Image> MediaControlTextTrackContainerElement::createTextTrackRepresen
         deviceScaleFactor = page->deviceScaleFactor();
 
     IntRect paintingRect = IntRect(IntPoint(), layer->size());
+
     OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor, ColorSpaceDeviceRGB));
     if (!buffer)
-        return 0;
+        return nullptr;
 
     layer->paint(buffer->context(), paintingRect, PaintBehaviorFlattenCompositingLayers, 0, 0, RenderLayer::PaintLayerPaintingCompositingAllPhases);
 
index e042c6efa5711c92e1eba4cb8c570a30e7baa889..63e37fa8263b3091a62eec0d3d57250e735be783 100644 (file)
@@ -56,7 +56,7 @@ HTMLMeterElement* MeterShadowElement::meterElement() const
 
 bool MeterShadowElement::rendererIsNeeded(const RenderStyle& style)
 {
-    RenderObject* render = meterElement()->renderer();
+    auto render = meterElement()->renderer();
     return render && !render->theme()->supportsMeter(render->style()->appearance()) && HTMLDivElement::rendererIsNeeded(style);
 }
 
@@ -72,7 +72,7 @@ bool MeterInnerElement::rendererIsNeeded(const RenderStyle& style)
     if (meterElement()->hasAuthorShadowRoot())
         return HTMLDivElement::rendererIsNeeded(style);
 
-    RenderObject* render = meterElement()->renderer();
+    auto render = meterElement()->renderer();
     return render && !render->theme()->supportsMeter(render->style()->appearance()) && HTMLDivElement::rendererIsNeeded(style);
 }
 
index b0041ee450fd8d50c5b08f9c9131a56a1decf369..e660cc31a99a46662be3b0c1f6959692702fc779 100644 (file)
@@ -248,7 +248,7 @@ void InspectorLayerTreeAgent::reasonsForCompositingLayer(ErrorString* errorStrin
         return;
     }
 
-    CompositingReasons reasonsBitmask = renderLayer->compositor().reasonsForCompositing(renderLayer);
+    CompositingReasons reasonsBitmask = renderLayer->compositor().reasonsForCompositing(*renderLayer);
     compositingReasons = TypeBuilder::LayerTree::CompositingReasons::create();
 
     if (reasonsBitmask & CompositingReason3DTransform)
index 7a9ecace5024c954d6890c86c21915091b51d7fa..975d5a675538ae8a76e7c42f48002998fe666792 100644 (file)
 #include "Node.h"
 #include "Page.h"
 #include "RenderBoxModelObject.h"
+#include "RenderElement.h"
 #include "RenderFlowThread.h"
 #include "RenderInline.h"
 #include "RenderNamedFlowThread.h"
-#include "RenderObject.h"
 #include "RenderRegion.h"
 #include "RenderView.h"
 #include "ScriptController.h"
index 7afafc09442fb2d0d0f2d6d544d07f2cb0c4605d..0aad63978e704dd58a425dc9c88353c099c9b8c7 100644 (file)
@@ -47,7 +47,7 @@
 #include "InspectorState.h"
 #include "InstrumentingAgents.h"
 #include "IntRect.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include "RenderView.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
index 4592cb1675818db41acf63fa2be70d40b41cdba8..8f3f3c2ae56f5d0f69c5302e35809d3d8c6a76ba 100644 (file)
@@ -44,6 +44,7 @@
 #include <wtf/WeakPtr.h>
 
 namespace WebCore {
+
 class Event;
 class FloatQuad;
 class Frame;
@@ -259,7 +260,7 @@ private:
     void innerAddRecordToTimeline(PassRefPtr<InspectorObject>, TimelineRecordType);
     void clearRecordStack();
 
-    void localToPageQuad(const RenderObject& renderer, const LayoutRect&, FloatQuad*);
+    void localToPageQuad(const RenderObject&, const LayoutRect&, FloatQuad*);
     const TimelineTimeConverter& timeConverter() const { return m_timeConverter; }
     double timestamp();
     Page* page();
index 11ec989abd7883cfc72e93a2f8229d893ac00f45..c54ca25af32d9c32c29e964188b1b7f77a093492 100644 (file)
@@ -318,14 +318,13 @@ void ImageLoader::notifyFinished(CachedResource* resource)
 
 RenderImageResource* ImageLoader::renderImageResource()
 {
-    RenderObject* renderer = m_element->renderer();
-
+    auto renderer = m_element->renderer();
     if (!renderer)
-        return 0;
+        return nullptr;
 
     // We don't return style generated image because it doesn't belong to the ImageLoader.
     // See <https://bugs.webkit.org/show_bug.cgi?id=42840>
-    if (renderer->isImage() && !static_cast<RenderImage*>(renderer)->isGeneratedContent())
+    if (renderer->isImage() && !toRenderImage(*renderer).isGeneratedContent())
         return toRenderImage(*renderer).imageResource();
 
 #if ENABLE(SVG)
@@ -338,7 +337,7 @@ RenderImageResource* ImageLoader::renderImageResource()
         return toRenderVideo(*renderer).imageResource();
 #endif
 
-    return 0;
+    return nullptr;
 }
 
 void ImageLoader::updateRenderer()
index 29b311dfbf3973eb2619dbb66b21d076f3ba1765..eef5adddf17229dfc5f4c1234070ce816dc2d61e 100644 (file)
@@ -36,7 +36,7 @@
 #include "FrameView.h"
 #include "MemoryCache.h"
 #include "Page.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include "ResourceBuffer.h"
 #include "Settings.h"
 #include "SubresourceLoader.h"
@@ -524,7 +524,7 @@ void CachedImage::resumeAnimatingImagesForLoader(CachedResourceLoader* loader)
     }
 }
 
-bool CachedImage::currentFrameKnownToBeOpaque(const RenderObject* renderer)
+bool CachedImage::currentFrameKnownToBeOpaque(const RenderElement* renderer)
 {
     Image* image = imageForRenderer(renderer);
     if (image->isBitmapImage())
index 431b740626a86db799edc9a6723377d73789283f..6be123d352e9438c62704cd202402407b112699e 100644 (file)
@@ -38,7 +38,9 @@ class CachedImageClient;
 class CachedResourceLoader;
 class FloatSize;
 class MemoryCache;
+class RenderElement;
 class RenderObject;
+
 struct Length;
 
 class CachedImage FINAL : public CachedResource, public ImageObserver {
@@ -52,7 +54,7 @@ public:
     Image* image(); // Returns the nullImage() if the image is not available yet.
     Image* imageForRenderer(const RenderObject*); // Returns the nullImage() if the image is not available yet.
     bool hasImage() const { return m_image.get(); }
-    bool currentFrameKnownToBeOpaque(const RenderObject*); // Side effect: ensures decoded image is in cache, therefore should only be called when about to draw the image.
+    bool currentFrameKnownToBeOpaque(const RenderElement*); // Side effect: ensures decoded image is in cache, therefore should only be called when about to draw the image.
 
     std::pair<Image*, float> brokenImage(float deviceScaleFactor) const; // Returns an image and the image's resolution scale factor.
     bool willPaintBrokenImage() const; 
index 55b476b7df8ac1abea44ac7bd60416b511a48f4c..06eea48e4bf7ced4e3759bf3d578e735fca10446 100644 (file)
@@ -32,7 +32,6 @@
 #include "MathMLElement.h"
 
 #include "MathMLNames.h"
-#include "RenderObject.h"
 #include "RenderTableCell.h"
 
 namespace WebCore {
index a63c073381befae3e6116bee6baa95799093bd1f..171cbd912d12024983655adeaddcd7a2ef5f1618 100644 (file)
@@ -60,7 +60,6 @@
 #include "Node.h"
 #include "Page.h"
 #include "PlatformEvent.h"
-#include "RenderObject.h"
 #include "ReplaceSelectionCommand.h"
 #include "ResourceRequest.h"
 #include "Settings.h"
index 794227a7b611d32dfbcbcf0fc1eede6a1cf5a054..cf41784d621b7a70b32549b3765430f0d28d7433 100644 (file)
@@ -632,36 +632,30 @@ Element* DragController::draggableElement(const Frame* sourceFrame, Element* sta
     if (!startElement)
         return 0;
 
-    for (const RenderObject* renderer = startElement->renderer(); renderer; renderer = renderer->parent()) {
-        Node* node = renderer->nonPseudoNode();
-        if (!node)
-            // Anonymous render blocks don't correspond to actual DOM nodes, so we skip over them
-            // for the purposes of finding a draggable node.
+    for (auto renderer = startElement->renderer(); renderer; renderer = renderer->parent()) {
+        Element* element = renderer->nonPseudoElement();
+        if (!element) {
+            // Anonymous render blocks don't correspond to actual DOM elements, so we skip over them
+            // for the purposes of finding a draggable element.
             continue;
-        if (!(state.type & DragSourceActionSelection) && node->isTextNode() && node->canStartSelection())
-            // In this case we have a click in the unselected portion of text. If this text is
-            // selectable, we want to start the selection process instead of looking for a parent
-            // to try to drag.
-            return 0;
-        if (node->isElementNode()) {
-            EUserDrag dragMode = renderer->style()->userDrag();
-            if ((m_dragSourceAction & DragSourceActionDHTML) && dragMode == DRAG_ELEMENT) {
-                state.type = static_cast<DragSourceAction>(state.type | DragSourceActionDHTML);
-                return toElement(node);
+        }
+        EUserDrag dragMode = renderer->style()->userDrag();
+        if ((m_dragSourceAction & DragSourceActionDHTML) && dragMode == DRAG_ELEMENT) {
+            state.type = static_cast<DragSourceAction>(state.type | DragSourceActionDHTML);
+            return element;
+        }
+        if (dragMode == DRAG_AUTO) {
+            if ((m_dragSourceAction & DragSourceActionImage)
+                && isHTMLImageElement(element)
+                && sourceFrame->settings().loadsImagesAutomatically()) {
+                state.type = static_cast<DragSourceAction>(state.type | DragSourceActionImage);
+                return element;
             }
-            if (dragMode == DRAG_AUTO) {
-                if ((m_dragSourceAction & DragSourceActionImage)
-                    && isHTMLImageElement(node)
-                    && sourceFrame->settings().loadsImagesAutomatically()) {
-                    state.type = static_cast<DragSourceAction>(state.type | DragSourceActionImage);
-                    return toElement(node);
-                }
-                if ((m_dragSourceAction & DragSourceActionLink)
-                    && isHTMLAnchorElement(node)
-                    && toHTMLAnchorElement(node)->isLiveLink()) {
-                    state.type = static_cast<DragSourceAction>(state.type | DragSourceActionLink);
-                    return toElement(node);
-                }
+            if ((m_dragSourceAction & DragSourceActionLink)
+                && isHTMLAnchorElement(element)
+                && toHTMLAnchorElement(element)->isLiveLink()) {
+                state.type = static_cast<DragSourceAction>(state.type | DragSourceActionLink);
+                return element;
             }
         }
     }
index a5f8ec32aa4932399f7dd59e3356daeffa9fadb9..5fde2c467aaafbdadace1f6937dc1e07cdcb9bd2 100644 (file)
@@ -344,7 +344,7 @@ EventHandler::EventHandler(Frame& frame)
     , m_touchPressed(false)
 #endif
 #if ENABLE(GESTURE_EVENTS)
-    , m_scrollGestureHandlingNode(0)
+    , m_scrollGestureHandlingNode(nullptr)
     , m_lastHitTestResultOverWidget(false)
 #endif
     , m_maxMouseMovedDuration(0)
@@ -413,7 +413,7 @@ void EventHandler::clear()
     m_originatingTouchPointTargetKey = 0;
 #endif
 #if ENABLE(GESTURE_EVENTS)
-    m_scrollGestureHandlingNode = 0;
+    m_scrollGestureHandlingNode = nullptr;
     m_lastHitTestResultOverWidget = false;
     m_previousGestureScrolledElement = nullptr;
     m_scrollbarHandlingScrollGesture = 0;
@@ -980,7 +980,7 @@ void EventHandler::didPanScrollStop()
     m_autoscrollController->didPanScrollStop();
 }
 
-void EventHandler::startPanScrolling(RenderObject* renderer)
+void EventHandler::startPanScrolling(RenderElement* renderer)
 {
     if (!renderer->isBox())
         return;
@@ -990,7 +990,7 @@ void EventHandler::startPanScrolling(RenderObject* renderer)
 
 #endif // ENABLE(PAN_SCROLLING)
 
-RenderObject* EventHandler::autoscrollRenderer() const
+RenderElement* EventHandler::autoscrollRenderer() const
 {
     return m_autoscrollController->autoscrollRenderer();
 }
@@ -1082,7 +1082,7 @@ bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity g
         node = m_mousePressNode.get();
     
     if (node) {
-        RenderObject* r = node->renderer();
+        auto r = node->renderer();
         if (r && !r->isListBox() && r->enclosingBox()->scroll(direction, granularity)) {
             setFrameWasScrolledByUser();
             return true;
@@ -1103,7 +1103,7 @@ bool EventHandler::logicalScrollOverflow(ScrollLogicalDirection direction, Scrol
         node = m_mousePressNode.get();
     
     if (node) {
-        RenderObject* r = node->renderer();
+        auto r = node->renderer();
         if (r && !r->isListBox() && r->enclosingBox()->logicalScroll(direction, granularity)) {
             setFrameWasScrolledByUser();
             return true;
@@ -1176,7 +1176,7 @@ Frame* EventHandler::subframeForTargetNode(Node* node)
     if (!node)
         return 0;
 
-    RenderObject* renderer = node->renderer();
+    auto renderer = node->renderer();
     if (!renderer || !renderer->isWidget())
         return 0;
 
@@ -1290,7 +1290,7 @@ OptionalCursor EventHandler::selectCursor(const HitTestResult& result, bool shif
     if (!node)
         return NoCursorChange;
 
-    RenderObject* renderer = node->renderer();
+    auto renderer = node->renderer();
     RenderStyle* style = renderer ? renderer->style() : 0;
     bool horizontalText = !style || style->isHorizontalWritingMode();
     const Cursor& iBeam = horizontalText ? iBeamCursor() : verticalTextCursor();
@@ -1672,7 +1672,7 @@ static RenderLayer* layerForNode(Node* node)
     if (!node)
         return 0;
 
-    RenderObject* renderer = node->renderer();
+    auto renderer = node->renderer();
     if (!renderer)
         return 0;
 
@@ -2454,10 +2454,9 @@ EventHandler::DominantScrollGestureDirection EventHandler::dominantScrollGesture
 
 bool EventHandler::handleWheelEvent(const PlatformWheelEvent& e)
 {
-    Document* doc = m_frame.document();
+    Document* document = m_frame.document();
 
-    RenderObject* docRenderer = doc->renderView();
-    if (!docRenderer)
+    if (!document->renderView())
         return false;
     
     RefPtr<FrameView> protector(m_frame.view());
@@ -2472,7 +2471,7 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& e)
 
     HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::DisallowShadowContent);
     HitTestResult result(vPoint);
-    doc->renderView()->hitTest(request, result);
+    document->renderView()->hitTest(request, result);
 
     bool useLatchedWheelEventElement = e.useLatchedEventElement();
 
@@ -2887,7 +2886,7 @@ bool EventHandler::sendScrollEventToView(const PlatformGestureEvent& gestureEven
 
 void EventHandler::clearGestureScrollNodes()
 {
-    m_scrollGestureHandlingNode = 0;
+    m_scrollGestureHandlingNode = nullptr;
     m_previousGestureScrolledElement = nullptr;
 }
 
index d580656cfa8b87580485654361abaa2d63ed72d2..6e98050ed753927a0101b05742212d6bd7449b6f 100644 (file)
@@ -71,6 +71,7 @@ class OptionalCursor;
 class PlatformKeyboardEvent;
 class PlatformTouchEvent;
 class PlatformWheelEvent;
+class RenderElement;
 class RenderLayer;
 class RenderObject;
 class RenderWidget;
@@ -117,11 +118,11 @@ public:
 #if ENABLE(PAN_SCROLLING)
     void didPanScrollStart();
     void didPanScrollStop();
-    void startPanScrolling(RenderObject*);
+    void startPanScrolling(RenderElement*);
 #endif
 
     void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
-    RenderObject* autoscrollRenderer() const;
+    RenderElement* autoscrollRenderer() const;
     void updateAutoscrollRenderer();
     bool autoscrollInProgress() const;
     bool mouseDownWasInSubframe() const { return m_mouseDownWasInSubframe; }
index 7136a65ad40a2a7874feb2e43cb6abc64fb5c5f8..0123f75ba6d993b8f5f88b977191db1b6884cd41 100644 (file)
@@ -52,7 +52,6 @@
 #include "NodeRenderingTraversal.h"
 #include "Page.h"
 #include "Range.h"
-#include "RenderObject.h"
 #include "RenderWidget.h"
 #include "ScrollAnimator.h"
 #include "Settings.h"
index f4ab60c94f380f598c626c7c3f0ca43775f7fe04..21011baecae69eb55775f51a81dd323259451463 100644 (file)
@@ -571,7 +571,7 @@ RenderWidget* Frame::ownerRenderer() const
     HTMLFrameOwnerElement* ownerElement = m_ownerElement;
     if (!ownerElement)
         return 0;
-    RenderObject* object = ownerElement->renderer();
+    auto object = ownerElement->renderer();
     if (!object)
         return 0;
     // FIXME: If <object> is ever fixed to disassociate itself from frames
@@ -664,7 +664,7 @@ VisiblePosition Frame::visiblePositionForPoint(const IntPoint& framePoint)
     Node* node = result.innerNonSharedNode();
     if (!node)
         return VisiblePosition();
-    RenderObject* renderer = node->renderer();
+    auto renderer = node->renderer();
     if (!renderer)
         return VisiblePosition();
     VisiblePosition visiblePos = renderer->positionForPoint(result.localPoint());
@@ -1001,7 +1001,7 @@ struct ScopedFramePaintingState {
 DragImageRef Frame::nodeImage(Node* node)
 {
     if (!node->renderer())
-        return 0;
+        return nullptr;
 
     const ScopedFramePaintingState state(this, node);
 
@@ -1012,10 +1012,10 @@ DragImageRef Frame::nodeImage(Node* node)
     m_doc->updateLayout();
     m_view->setNodeToDraw(node); // Enable special sub-tree drawing mode.
 
-    // Document::updateLayout may have blown away the original RenderObject.
-    RenderObject* renderer = node->renderer();
+    // Document::updateLayout may have blown away the original renderer.
+    auto renderer = node->renderer();
     if (!renderer)
-      return 0;
+        return nullptr;
 
     LayoutRect topLevelRect;
     IntRect paintingRect = pixelSnappedIntRect(renderer->paintingRootRect(topLevelRect));
@@ -1028,7 +1028,7 @@ DragImageRef Frame::nodeImage(Node* node)
 
     OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor, ColorSpaceDeviceRGB));
     if (!buffer)
-        return 0;
+        return nullptr;
     buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
     buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
 
index c747b0e3ed1d0782de2aa0cdf1d06b349a9a5222..7d60d03cb9c7e3abd6e8601dd17024d31b9767cb 100644 (file)
@@ -598,7 +598,7 @@ void FrameView::adjustViewSize()
     setContentsSize(size);
 }
 
-void FrameView::applyOverflowToViewport(RenderObject* o, ScrollbarMode& hMode, ScrollbarMode& vMode)
+void FrameView::applyOverflowToViewport(RenderElement* o, ScrollbarMode& hMode, ScrollbarMode& vMode)
 {
     // Handle the overflow:hidden/scroll case for the body/html elements.  WinIE treats
     // overflow:hidden and overflow:scroll on <body> as applying to the document's
@@ -666,10 +666,10 @@ void FrameView::applyOverflowToViewport(RenderObject* o, ScrollbarMode& hMode, S
 void FrameView::applyPaginationToViewport()
 {
     Document* document = frame().document();
-    Node* documentElement = document->documentElement();
-    RenderObject* documentRenderer = documentElement ? documentElement->renderer() : 0;
-    RenderObject* documentOrBodyRenderer = documentRenderer;
-    Node* body = document->body();
+    auto documentElement = document->documentElement();
+    RenderElement* documentRenderer = documentElement ? documentElement->renderer() : nullptr;
+    RenderElement* documentOrBodyRenderer = documentRenderer;
+    auto body = document->body();
     if (body && body->renderer()) {
         if (body->hasTagName(bodyTag))
             documentOrBodyRenderer = documentRenderer->style()->overflowX() == OVISIBLE && documentElement->hasTagName(htmlTag) ? body->renderer() : documentRenderer;
@@ -716,9 +716,9 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
     
     if (!m_layoutRoot) {
         Document* document = frame().document();
-        Node* documentElement = document->documentElement();
-        RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0;
-        Node* body = document->body();
+        auto documentElement = document->documentElement();
+        RenderElement* rootRenderer = documentElement ? documentElement->renderer() : nullptr;
+        auto body = document->body();
         if (body && body->renderer()) {
             if (body->hasTagName(framesetTag) && !frameFlatteningEnabled()) {
                 vMode = ScrollbarAlwaysOff;
@@ -726,7 +726,7 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
             } else if (body->hasTagName(bodyTag)) {
                 // It's sufficient to just check the X overflow,
                 // since it's illegal to have visible in only one direction.
-                RenderObject* o = rootRenderer->style()->overflowX() == OVISIBLE && document->documentElement()->hasTagName(htmlTag) ? body->renderer() : rootRenderer;
+                RenderElement* o = rootRenderer->style()->overflowX() == OVISIBLE && document->documentElement()->hasTagName(htmlTag) ? body->renderer() : rootRenderer;
                 applyOverflowToViewport(o, hMode, vMode);
             }
         } else if (rootRenderer)
@@ -986,7 +986,7 @@ void FrameView::enterCompositingMode()
 bool FrameView::isEnclosedInCompositingLayer() const
 {
 #if USE(ACCELERATED_COMPOSITING)
-    RenderObject* frameOwnerRenderer = frame().ownerRenderer();
+    auto frameOwnerRenderer = frame().ownerRenderer();
     if (frameOwnerRenderer && frameOwnerRenderer->containerForRepaint())
         return true;
 
@@ -995,7 +995,7 @@ bool FrameView::isEnclosedInCompositingLayer() const
 #endif
     return false;
 }
-    
+
 bool FrameView::flushCompositingStateIncludingSubframes()
 {
 #if USE(ACCELERATED_COMPOSITING)
@@ -1371,18 +1371,18 @@ RenderBox* FrameView::embeddedContentBox() const
 #if ENABLE(SVG)
     RenderView* renderView = this->renderView();
     if (!renderView)
-        return 0;
+        return nullptr;
 
     RenderObject* firstChild = renderView->firstChild();
     if (!firstChild || !firstChild->isBox())
-        return 0;
+        return nullptr;
 
     // Curently only embedded SVG documents participate in the size-negotiation logic.
-    if (firstChild->isSVGRoot())
+    if (toRenderBox(firstChild)->isSVGRoot())
         return toRenderBox(firstChild);
 #endif
 
-    return 0;
+    return nullptr;
 }
 
 void FrameView::addEmbeddedObjectToUpdate(RenderEmbeddedObject& embeddedObject)
@@ -1491,12 +1491,12 @@ void FrameView::setCannotBlitToWindow()
     updateCanBlitOnScrollRecursively();
 }
 
-void FrameView::addSlowRepaintObject(RenderObject* o)
+void FrameView::addSlowRepaintObject(RenderElement* o)
 {
     bool hadSlowRepaintObjects = hasSlowRepaintObjects();
 
     if (!m_slowRepaintObjects)
-        m_slowRepaintObjects = adoptPtr(new RenderObjectSet);
+        m_slowRepaintObjects = adoptPtr(new HashSet<RenderElement*>);
 
     m_slowRepaintObjects->add(o);
 
@@ -1510,7 +1510,7 @@ void FrameView::addSlowRepaintObject(RenderObject* o)
     }
 }
 
-void FrameView::removeSlowRepaintObject(RenderObject* o)
+void FrameView::removeSlowRepaintObject(RenderElement* o)
 {
     if (!m_slowRepaintObjects)
         return;
@@ -1527,7 +1527,7 @@ void FrameView::removeSlowRepaintObject(RenderObject* o)
     }
 }
 
-void FrameView::addViewportConstrainedObject(RenderObject* object)
+void FrameView::addViewportConstrainedObject(RenderElement* object)
 {
     if (!m_viewportConstrainedObjects)
         m_viewportConstrainedObjects = adoptPtr(new ViewportConstrainedObjectSet);
@@ -1544,7 +1544,7 @@ void FrameView::addViewportConstrainedObject(RenderObject* object)
     }
 }
 
-void FrameView::removeViewportConstrainedObject(RenderObject* object)
+void FrameView::removeViewportConstrainedObject(RenderElement* object)
 {
     if (m_viewportConstrainedObjects && m_viewportConstrainedObjects->remove(object)) {
         if (Page* page = frame().page()) {
@@ -1641,16 +1641,15 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
 
     // Get the rects of the fixed objects visible in the rectToScroll
     Region regionToUpdate;
-    ViewportConstrainedObjectSet::const_iterator end = m_viewportConstrainedObjects->end();
-    for (ViewportConstrainedObjectSet::const_iterator it = m_viewportConstrainedObjects->begin(); it != end; ++it) {
-        RenderObject* renderer = *it;
+    for (auto it = m_viewportConstrainedObjects->begin(), end = m_viewportConstrainedObjects->end(); it != end; ++it) {
+        RenderElement* renderer = *it;
         if (!renderer->style()->hasViewportConstrainedPosition())
             continue;
 #if USE(ACCELERATED_COMPOSITING)
         if (renderer->isComposited())
             continue;
 #endif
-    
+
         // Fixed items should always have layers.
         ASSERT(renderer->hasLayer());
         RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
@@ -1742,11 +1741,8 @@ void FrameView::repaintSlowRepaintObjects()
 
     // Renderers with fixed backgrounds may be in compositing layers, so we need to explicitly
     // repaint them after scrolling.
-    RenderObjectSet::const_iterator end = m_slowRepaintObjects->end();
-    for (RenderObjectSet::const_iterator it = m_slowRepaintObjects->begin(); it != end; ++it) {
-        RenderObject* renderer = *it;
-        renderer->repaint();
-    }
+    for (auto it = m_slowRepaintObjects->begin(), end = m_slowRepaintObjects->end(); it != end; ++it)
+        (*it)->repaint();
 }
 
 // Note that this gets called at painting time.
@@ -1945,11 +1941,8 @@ void FrameView::setViewportConstrainedObjectsNeedLayout()
     if (!hasViewportConstrainedObjects())
         return;
 
-    ViewportConstrainedObjectSet::const_iterator end = m_viewportConstrainedObjects->end();
-    for (ViewportConstrainedObjectSet::const_iterator it = m_viewportConstrainedObjects->begin(); it != end; ++it) {
-        RenderObject* renderer = *it;
-        renderer->setNeedsLayout(true);
-    }
+    for (auto it = m_viewportConstrainedObjects->begin(), end = m_viewportConstrainedObjects->end(); it != end; ++it)
+        (*it)->setNeedsLayout(true);
 }
 
 void FrameView::scrollPositionChangedViaPlatformWidget()
@@ -2977,8 +2970,7 @@ void FrameView::updateOverflowStatus(bool horizontalOverflow, bool verticalOverf
         m_verticalOverflow = verticalOverflow;
         
         scheduleEvent(OverflowEvent::create(horizontalOverflowChanged, horizontalOverflow,
-            verticalOverflowChanged, verticalOverflow),
-            m_viewportRenderer->node());
+            verticalOverflowChanged, verticalOverflow), m_viewportRenderer->element());
     }
     
 }
@@ -3213,7 +3205,7 @@ void FrameView::updateAnnotatedRegions()
 
 void FrameView::updateScrollCorner()
 {
-    RenderObject* renderer = 0;
+    RenderElement* renderer = 0;
     RefPtr<RenderStyle> cornerStyle;
     IntRect cornerRect = scrollCornerRect();
     
@@ -3518,7 +3510,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
     RenderLayer* rootLayer = renderView->layer();
 
 #ifndef NDEBUG
-    RenderObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(&rootLayer->renderer());
+    RenderElement::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(&rootLayer->renderer());
 #endif
 
     rootLayer->paint(p, rect, m_paintBehavior, eltRenderer);
@@ -3801,7 +3793,7 @@ void FrameView::adjustPageHeightDeprecated(float *newBottom, float oldTop, float
     renderView->setPrintRect(IntRect());
 }
 
-IntRect FrameView::convertFromRenderer(const RenderObject* renderer, const IntRect& rendererRect) const
+IntRect FrameView::convertFromRenderer(const RenderElement* renderer, const IntRect& rendererRect) const
 {
     IntRect rect = pixelSnappedIntRect(enclosingLayoutRect(renderer->localToAbsoluteQuad(FloatRect(rendererRect)).boundingBox()));
 
@@ -3812,7 +3804,7 @@ IntRect FrameView::convertFromRenderer(const RenderObject* renderer, const IntRe
     return rect;
 }
 
-IntRect FrameView::convertToRenderer(const RenderObject* renderer, const IntRect& viewRect) const
+IntRect FrameView::convertToRenderer(const RenderElement* renderer, const IntRect& viewRect) const
 {
     IntRect rect = viewRect;
     
@@ -3826,7 +3818,7 @@ IntRect FrameView::convertToRenderer(const RenderObject* renderer, const IntRect
     return rect;
 }
 
-IntPoint FrameView::convertFromRenderer(const RenderObject* renderer, const IntPoint& rendererPoint) const
+IntPoint FrameView::convertFromRenderer(const RenderElement* renderer, const IntPoint& rendererPoint) const
 {
     IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, UseTransforms));
 
@@ -3836,7 +3828,7 @@ IntPoint FrameView::convertFromRenderer(const RenderObject* renderer, const IntP
     return point;
 }
 
-IntPoint FrameView::convertToRenderer(const RenderObject* renderer, const IntPoint& viewPoint) const
+IntPoint FrameView::convertToRenderer(const RenderElement* renderer, const IntPoint& viewPoint) const
 {
     IntPoint point = viewPoint;
 
index 86c58cdf97f23535309270388ab2b07d9da61f50..7c31824e0d98347bfa3b4429aedecaf83a61c7ab 100644 (file)
@@ -49,6 +49,7 @@ class URL;
 class Node;
 class Page;
 class RenderBox;
+class RenderElement;
 class RenderEmbeddedObject;
 class RenderLayer;
 class RenderObject;
@@ -111,7 +112,7 @@ public:
     bool isInLayout() const { return m_inLayout; }
 
     RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
-    void clearLayoutRoot() { m_layoutRoot = 0; }
+    void clearLayoutRoot() { m_layoutRoot = nullptr; }
     int layoutCount() const { return m_layoutCount; }
 
     bool needsLayout() const;
@@ -217,15 +218,15 @@ public:
     bool isOverlappedIncludingAncestors() const;
     void setContentIsOpaque(bool);
 
-    void addSlowRepaintObject(RenderObject*);
-    void removeSlowRepaintObject(RenderObject*);
-    bool hasSlowRepaintObject(RenderObject* o) const { return m_slowRepaintObjects && m_slowRepaintObjects->contains(o); }
+    void addSlowRepaintObject(RenderElement*);
+    void removeSlowRepaintObject(RenderElement*);
+    bool hasSlowRepaintObject(RenderElement* o) const { return m_slowRepaintObjects && m_slowRepaintObjects->contains(o); }
     bool hasSlowRepaintObjects() const { return m_slowRepaintObjects && m_slowRepaintObjects->size(); }
 
     // Includes fixed- and sticky-position objects.
-    typedef HashSet<RenderObject*> ViewportConstrainedObjectSet;
-    void addViewportConstrainedObject(RenderObject*);
-    void removeViewportConstrainedObject(RenderObject*);
+    typedef HashSet<RenderElement*> ViewportConstrainedObjectSet;
+    void addViewportConstrainedObject(RenderElement*);
+    void removeViewportConstrainedObject(RenderElement*);
     const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); }
     bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; }
 
@@ -331,10 +332,10 @@ public:
     void scrollElementToRect(Element*, const IntRect&);
 
     // Methods to convert points and rects between the coordinate space of the renderer, and this view.
-    IntRect convertFromRenderer(const RenderObject*, const IntRect&) const;
-    IntRect convertToRenderer(const RenderObject*, const IntRect&) const;
-    IntPoint convertFromRenderer(const RenderObject*, const IntPoint&) const;
-    IntPoint convertToRenderer(const RenderObject*, const IntPoint&) const;
+    IntRect convertFromRenderer(const RenderElement*, const IntRect&) const;
+    IntRect convertToRenderer(const RenderElement*, const IntRect&) const;
+    IntPoint convertFromRenderer(const RenderElement*, const IntPoint&) const;
+    IntPoint convertToRenderer(const RenderElement*, const IntPoint&) const;
 
     bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
 
@@ -459,7 +460,7 @@ private:
 
     bool shouldUpdateFixedElementsAfterScrolling();
 
-    void applyOverflowToViewport(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
+    void applyOverflowToViewport(RenderElement*, ScrollbarMode& hMode, ScrollbarMode& vMode);
     void applyPaginationToViewport();
 
     void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
@@ -551,8 +552,7 @@ private:
     OwnPtr<ListHashSet<RenderEmbeddedObject*>> m_embeddedObjectsToUpdate;
     const RefPtr<Frame> m_frame;
 
-    typedef HashSet<RenderObject*> RenderObjectSet;
-    OwnPtr<RenderObjectSet> m_slowRepaintObjects;
+    OwnPtr<HashSet<RenderElement*>> m_slowRepaintObjects;
 
     bool m_needsFullRepaint;
     
@@ -589,7 +589,7 @@ private:
     bool m_overflowStatusDirty;
     bool m_horizontalOverflow;
     bool m_verticalOverflow;    
-    RenderObject* m_viewportRenderer;
+    RenderElement* m_viewportRenderer;
 
     Pagination m_pagination;
 
index 9a48f858befc12ed64ee903683ad9eaa8d3c25c9..6b1d9cb6c5f452acc03f86b3f5ba5c7ae1ed3f14 100644 (file)
@@ -291,7 +291,7 @@ void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const URL
     }
 }
 
-void PageSerializer::addImageToResources(CachedImage* image, RenderObject* imageRenderer, const URL& url)
+void PageSerializer::addImageToResources(CachedImage* image, RenderElement* imageRenderer, const URL& url)
 {
     if (!url.isValid() || m_resourceURLs.contains(url))
         return;
index 1731d39e0b00735f80c24b6429f141f4ab9ff665..27898ea6eaea42f1cd3ce486549bf23d7f5ebebb 100644 (file)
@@ -45,7 +45,7 @@ class CSSStyleSheet;
 class Document;
 class Frame;
 class Page;
-class RenderObject;
+class RenderElement;
 class StylePropertySet;
 class StyleRule;
 
@@ -77,7 +77,7 @@ private:
     // It also adds any resources included in that stylesheet (including any imported stylesheets and their own resources).
     void serializeCSSStyleSheet(CSSStyleSheet*, const URL&);
 
-    void addImageToResources(CachedImage*, RenderObject*, const URL&);
+    void addImageToResources(CachedImage*, RenderElement*, const URL&);
     void retrieveResourcesForProperties(const StylePropertySet*, Document*);
     void retrieveResourcesForRule(StyleRule*, Document*);
 
index ba70b6b5a48ebce24406544527e202b407eace6c..37ccaf58098f260a29b8b014bf136b4133554240 100644 (file)
@@ -70,7 +70,7 @@ static inline double solveStepsFunction(int numSteps, bool stepAtStart, double t
     return floor(numSteps * t) / numSteps;
 }
 
-AnimationBase::AnimationBase(const Animation& transition, RenderObject* renderer, CompositeAnimation* compAnim)
+AnimationBase::AnimationBase(const Animation& transition, RenderElement* renderer, CompositeAnimation* compAnim)
     : m_animState(AnimationStateNew)
     , m_isAccelerated(false)
     , m_transformFunctionListValid(false)
@@ -223,7 +223,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
 
                 // Trigger a render so we can start the animation
                 if (m_object)
-                    m_compAnim->animationController()->addNodeChangeToDispatch(m_object->node());
+                    m_compAnim->animationController()->addNodeChangeToDispatch(m_object->element());
             } else {
                 ASSERT(!paused());
                 // We're waiting for the start timer to fire and we got a pause. Cancel the timer, pause and wait
@@ -288,7 +288,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
 
                 // Dispatch updateStyleIfNeeded so we can start the animation
                 if (m_object)
-                    m_compAnim->animationController()->addNodeChangeToDispatch(m_object->node());
+                    m_compAnim->animationController()->addNodeChangeToDispatch(m_object->element());
             } else {
                 // We are pausing while waiting for a start response. Cancel the animation and wait. When 
                 // we unpause, we will act as though the start timer just fired
@@ -338,7 +338,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
                         resumeOverriddenAnimations();
 
                     // Fire off another style change so we can set the final value
-                    m_compAnim->animationController()->addNodeChangeToDispatch(m_object->node());
+                    m_compAnim->animationController()->addNodeChangeToDispatch(m_object->element());
                 }
             } else {
                 // We are pausing while running. Cancel the animation and wait
index 26d732a77ad0b7d98deba57c0a70c7e2963107ce..2ba2d04d475692292b99b8b30e3d00d89a743cb2 100644 (file)
@@ -44,7 +44,7 @@ class AnimationController;
 class CompositeAnimation;
 class Element;
 class Node;
-class RenderObject;
+class RenderElement;
 class RenderStyle;
 class TimingFunction;
 
@@ -53,10 +53,10 @@ class AnimationBase : public RefCounted<AnimationBase> {
     friend class CSSPropertyAnimation;
 
 public:
-    AnimationBase(const Animation& transition, RenderObject* renderer, CompositeAnimation* compAnim);
+    AnimationBase(const Animation& transition, RenderElement*, CompositeAnimation*);
     virtual ~AnimationBase() { }
 
-    RenderObject* renderer() const { return m_object; }
+    RenderElement* renderer() const { return m_object; }
     void clear()
     {
       endAnimation();
@@ -134,7 +134,7 @@ public:
 
     double progress(double scale, double offset, const TimingFunction*) const;
 
-    virtual void animate(CompositeAnimation*, RenderObject*, const RenderStyle* /*currentStyle*/, RenderStyle* /*targetStyle*/, RefPtr<RenderStyle>& /*animatedStyle*/) = 0;
+    virtual void animate(CompositeAnimation*, RenderElement*, const RenderStyle* /*currentStyle*/, RenderStyle* /*targetStyle*/, RefPtr<RenderStyle>& /*animatedStyle*/) = 0;
     virtual void getAnimatedStyle(RefPtr<RenderStyle>& /*animatedStyle*/) = 0;
 
     virtual bool shouldFireEvents() const { return false; }
@@ -234,7 +234,7 @@ protected:
     double m_totalDuration;
     double m_nextIterationDuration;
 
-    RenderObject* m_object;
+    RenderElement* m_object;
 
     RefPtr<Animation> m_animation;
     CompositeAnimation* m_compAnim;
index 62eabc7294b3c4483bfc1584004a92f53109604f..ecb355f24387093d61717cedba4954159a31d770 100644 (file)
@@ -67,15 +67,15 @@ AnimationControllerPrivate::~AnimationControllerPrivate()
 {
 }
 
-CompositeAnimation& AnimationControllerPrivate::ensureCompositeAnimation(RenderObject* renderer)
+CompositeAnimation& AnimationControllerPrivate::ensureCompositeAnimation(RenderElement* renderer)
 {
-    RenderObjectAnimationMap::AddResult result = m_compositeAnimations.add(renderer, nullptr);
+    auto result = m_compositeAnimations.add(renderer, nullptr);
     if (result.isNewEntry)
         result.iterator->value = CompositeAnimation::create(this);
     return *result.iterator->value;
 }
 
-bool AnimationControllerPrivate::clear(RenderObject* renderer)
+bool AnimationControllerPrivate::clear(RenderElement* renderer)
 {
     // Return false if we didn't do anything OR we are suspended (so we don't try to
     // do a setNeedsStyleRecalc() when suspended).
@@ -91,22 +91,21 @@ double AnimationControllerPrivate::updateAnimations(SetChanged callSetChanged/*
     double timeToNextService = -1;
     bool calledSetChanged = false;
 
-    RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
-    for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
-        CompositeAnimation* compAnim = it->value.get();
-        if (!compAnim->isSuspended() && compAnim->hasAnimations()) {
-            double t = compAnim->timeToNextService();
+    auto end = m_compositeAnimations.end();
+    for (auto it = m_compositeAnimations.begin(); it != end; ++it) {
+        CompositeAnimation& animation = *it->value;
+        if (!animation.isSuspended() && animation.hasAnimations()) {
+            double t = animation.timeToNextService();
             if (t != -1 && (t < timeToNextService || timeToNextService == -1))
                 timeToNextService = t;
             if (!timeToNextService) {
-                if (callSetChanged == CallSetChanged) {
-                    Node* node = it->key->node();
-                    ASSERT(!node || !node->document().inPageCache());
-                    node->setNeedsStyleRecalc(SyntheticStyleChange);
-                    calledSetChanged = true;
-                }
-                else
+                if (callSetChanged != CallSetChanged)
                     break;
+                Element* element = it->key->element();
+                ASSERT(element);
+                ASSERT(!element->document().inPageCache());
+                element->setNeedsStyleRecalc(SyntheticStyleChange);
+                calledSetChanged = true;
             }
         }
     }
@@ -117,7 +116,7 @@ double AnimationControllerPrivate::updateAnimations(SetChanged callSetChanged/*
     return timeToNextService;
 }
 
-void AnimationControllerPrivate::updateAnimationTimerForRenderer(RenderObject* renderer)
+void AnimationControllerPrivate::updateAnimationTimerForRenderer(RenderElement* renderer)
 {
     double timeToNextService = 0;
 
@@ -243,22 +242,16 @@ void AnimationControllerPrivate::animationTimerFired(Timer<AnimationControllerPr
     fireEventsAndUpdateStyle();
 }
 
-bool AnimationControllerPrivate::isRunningAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+bool AnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const
 {
     const CompositeAnimation* animation = m_compositeAnimations.get(renderer);
-    if (!animation)
-        return false;
-
-    return animation->isAnimatingProperty(property, false, isRunningNow);
+    return animation && animation->isAnimatingProperty(property, false, isRunningNow);
 }
 
-bool AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+bool AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const
 {
     const CompositeAnimation* animation = m_compositeAnimations.get(renderer);
-    if (!animation)
-        return false;
-
-    return animation->isAnimatingProperty(property, true, isRunningNow);
+    return animation && animation->isAnimatingProperty(property, true, isRunningNow);
 }
 
 void AnimationControllerPrivate::suspendAnimations()
@@ -293,13 +286,9 @@ void AnimationControllerPrivate::suspendAnimationsForDocument(Document* document
 {
     setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
 
-    RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
-    for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
-        RenderObject* renderer = it->key;
-        if (&renderer->document() == document) {
-            CompositeAnimation* compAnim = it->value.get();
-            compAnim->suspendAnimations();
-        }
+    for (auto it = m_compositeAnimations.begin(), end = m_compositeAnimations.end(); it != end; ++it) {
+        if (&it->key->document() == document)
+            it->value->suspendAnimations();
     }
 
     updateAnimationTimer();
@@ -309,13 +298,9 @@ void AnimationControllerPrivate::resumeAnimationsForDocument(Document* document)
 {
     setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
 
-    RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
-    for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
-        RenderObject* renderer = it->key;
-        if (&renderer->document() == document) {
-            CompositeAnimation* compAnim = it->value.get();
-            compAnim->resumeAnimations();
-        }
+    for (auto it = m_compositeAnimations.begin(), end = m_compositeAnimations.end(); it != end; ++it) {
+        if (&it->key->document() == document)
+            it->value->resumeAnimations();
     }
 
     updateAnimationTimer();
@@ -332,14 +317,14 @@ void AnimationControllerPrivate::setAllowsNewAnimationsWhileSuspended(bool allow
     m_allowsNewAnimationsWhileSuspended = allowed;
 }
 
-bool AnimationControllerPrivate::pauseAnimationAtTime(RenderObject* renderer, const AtomicString& name, double t)
+bool AnimationControllerPrivate::pauseAnimationAtTime(RenderElement* renderer, const AtomicString& name, double t)
 {
     if (!renderer)
         return false;
 
     CompositeAnimation& compositeAnimation = ensureCompositeAnimation(renderer);
     if (compositeAnimation.pauseAnimationAtTime(name, t)) {
-        renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
+        renderer->element()->setNeedsStyleRecalc(SyntheticStyleChange);
         startUpdateStyleIfNeededDispatcher();
         return true;
     }
@@ -347,14 +332,14 @@ bool AnimationControllerPrivate::pauseAnimationAtTime(RenderObject* renderer, co
     return false;
 }
 
-bool AnimationControllerPrivate::pauseTransitionAtTime(RenderObject* renderer, const String& property, double t)
+bool AnimationControllerPrivate::pauseTransitionAtTime(RenderElement* renderer, const String& property, double t)
 {
     if (!renderer)
         return false;
 
     CompositeAnimation& compositeAnimation = ensureCompositeAnimation(renderer);
     if (compositeAnimation.pauseTransitionAtTime(cssPropertyID(property), t)) {
-        renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
+        renderer->element()->setNeedsStyleRecalc(SyntheticStyleChange);
         startUpdateStyleIfNeededDispatcher();
         return true;
     }
@@ -382,7 +367,7 @@ void AnimationControllerPrivate::receivedStartTimeResponse(double time)
     startTimeResponse(time);
 }
 
-PassRefPtr<RenderStyle> AnimationControllerPrivate::getAnimatedStyleForRenderer(RenderObject* renderer)
+PassRefPtr<RenderStyle> AnimationControllerPrivate::getAnimatedStyleForRenderer(RenderElement* renderer)
 {
     if (!renderer)
         return 0;
@@ -402,14 +387,11 @@ unsigned AnimationControllerPrivate::numberOfActiveAnimations(Document* document
 {
     unsigned count = 0;
     
-    RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
-    for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
-        RenderObject* renderer = it->key;
-        CompositeAnimation* compAnim = it->value.get();
-        if (&renderer->document() == document)
-            count += compAnim->numberOfActiveAnimations();
+    for (auto it = m_compositeAnimations.begin(), end = m_compositeAnimations.end(); it != end; ++it) {
+        if (&it->key->document() == document)
+            count += it->value->numberOfActiveAnimations();
     }
-    
+
     return count;
 }
 
@@ -500,20 +482,20 @@ AnimationController::~AnimationController()
 {
 }
 
-void AnimationController::cancelAnimations(RenderObject* renderer)
+void AnimationController::cancelAnimations(RenderElement* renderer)
 {
     if (!m_data->hasAnimations())
         return;
 
     if (m_data->clear(renderer)) {
-        Node* node = renderer->node();
-        ASSERT(!node || !node->document().inPageCache());
-        if (node)
-            node->setNeedsStyleRecalc(SyntheticStyleChange);
+        Element* element = renderer->element();
+        ASSERT(!element || !element->document().inPageCache());
+        if (element)
+            element->setNeedsStyleRecalc(SyntheticStyleChange);
     }
 }
 
-PassRefPtr<RenderStyle> AnimationController::updateAnimations(RenderObject* renderer, RenderStyle* newStyle)
+PassRefPtr<RenderStyle> AnimationController::updateAnimations(RenderElement* renderer, RenderStyle* newStyle)
 {
     // Don't do anything if we're in the cache
     if (renderer->document().inPageCache())
@@ -534,7 +516,7 @@ PassRefPtr<RenderStyle> AnimationController::updateAnimations(RenderObject* rend
     // a new style.
 
     // We don't support anonymous pseudo elements like :first-line or :first-letter.
-    ASSERT(renderer->node());
+    ASSERT(renderer->element());
 
     CompositeAnimation& rendererAnimations = m_data->ensureCompositeAnimation(renderer);
     RefPtr<RenderStyle> blendedStyle = rendererAnimations.animate(renderer, oldStyle, newStyle);
@@ -556,17 +538,17 @@ PassRefPtr<RenderStyle> AnimationController::updateAnimations(RenderObject* rend
     return blendedStyle.release();
 }
 
-PassRefPtr<RenderStyle> AnimationController::getAnimatedStyleForRenderer(RenderObject* renderer)
+PassRefPtr<RenderStyle> AnimationController::getAnimatedStyleForRenderer(RenderElement* renderer)
 {
     return m_data->getAnimatedStyleForRenderer(renderer);
 }
 
-void AnimationController::notifyAnimationStarted(RenderObject*, double startTime)
+void AnimationController::notifyAnimationStarted(RenderElement*, double startTime)
 {
     m_data->receivedStartTimeResponse(startTime);
 }
 
-bool AnimationController::pauseAnimationAtTime(RenderObject* renderer, const AtomicString& name, double t)
+bool AnimationController::pauseAnimationAtTime(RenderElement* renderer, const AtomicString& name, double t)
 {
     return m_data->pauseAnimationAtTime(renderer, name, t);
 }
@@ -576,17 +558,17 @@ unsigned AnimationController::numberOfActiveAnimations(Document* document) const
     return m_data->numberOfActiveAnimations(document);
 }
 
-bool AnimationController::pauseTransitionAtTime(RenderObject* renderer, const String& property, double t)
+bool AnimationController::pauseTransitionAtTime(RenderElement* renderer, const String& property, double t)
 {
     return m_data->pauseTransitionAtTime(renderer, property, t);
 }
 
-bool AnimationController::isRunningAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+bool AnimationController::isRunningAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const
 {
     return m_data->isRunningAnimationOnRenderer(renderer, property, isRunningNow);
 }
 
-bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
+bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderElement* renderer, CSSPropertyID property, bool isRunningNow) const
 {
     return m_data->isRunningAcceleratedAnimationOnRenderer(renderer, property, isRunningNow);
 }
index cc6291e3e6a16a54d345f352f2b46c122686317f..60c2032afab514201903c2097c84c045d0ca8641 100644 (file)
@@ -41,7 +41,7 @@ class Document;
 class Element;
 class Frame;
 class Node;
-class RenderObject;
+class RenderElement;
 class RenderStyle;
 
 class AnimationController {
@@ -49,19 +49,19 @@ public:
     explicit AnimationController(Frame&);
     ~AnimationController();
 
-    void cancelAnimations(RenderObject*);
-    PassRefPtr<RenderStyle> updateAnimations(RenderObject*, RenderStyle* newStyle);
-    PassRefPtr<RenderStyle> getAnimatedStyleForRenderer(RenderObject*);
+    void cancelAnimations(RenderElement*);
+    PassRefPtr<RenderStyle> updateAnimations(RenderElement*, RenderStyle* newStyle);
+    PassRefPtr<RenderStyle> getAnimatedStyleForRenderer(RenderElement*);
 
     // This is called when an accelerated animation or transition has actually started to animate.
-    void notifyAnimationStarted(RenderObject*, double startTime);
+    void notifyAnimationStarted(RenderElement*, double startTime);
 
-    bool pauseAnimationAtTime(RenderObject*, const AtomicString& name, double t); // To be used only for testing
-    bool pauseTransitionAtTime(RenderObject*, const String& property, double t); // To be used only for testing
+    bool pauseAnimationAtTime(RenderElement*, const AtomicString& name, double t); // To be used only for testing
+    bool pauseTransitionAtTime(RenderElement*, const String& property, double t); // To be used only for testing
     unsigned numberOfActiveAnimations(Document*) const; // To be used only for testing
     
-    bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
-    bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
+    bool isRunningAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow = true) const;
+    bool isRunningAcceleratedAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow = true) const;
 
     bool isSuspended() const;
     void suspendAnimations();
index 269bfdd0f5604303c97d5c377f54a80f92ca1918..95f1642c3c7bb6bc1ebb70881302721a6ba20c41 100644 (file)
@@ -47,7 +47,7 @@ class Document;
 class Element;
 class Frame;
 class Node;
-class RenderObject;
+class RenderElement;
 class RenderStyle;
 
 enum SetChanged {
@@ -65,8 +65,8 @@ public:
     double updateAnimations(SetChanged callSetChanged = DoNotCallSetChanged);
     void updateAnimationTimer(SetChanged callSetChanged = DoNotCallSetChanged);
 
-    CompositeAnimation& ensureCompositeAnimation(RenderObject*);
-    bool clear(RenderObject*);
+    CompositeAnimation& ensureCompositeAnimation(RenderElement*);
+    bool clear(RenderElement*);
 
     void updateStyleIfNeededDispatcherFired(Timer<AnimationControllerPrivate>*);
     void startUpdateStyleIfNeededDispatcher();
@@ -86,14 +86,14 @@ public:
     void resumeAnimationsForDocument(Document*);
     void startAnimationsIfNotSuspended(Document*);
 
-    bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const;
-    bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const;
+    bool isRunningAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow) const;
+    bool isRunningAcceleratedAnimationOnRenderer(RenderElement*, CSSPropertyID, bool isRunningNow) const;
 
-    bool pauseAnimationAtTime(RenderObject*, const AtomicString& name, double t);
-    bool pauseTransitionAtTime(RenderObject*, const String& property, double t);
+    bool pauseAnimationAtTime(RenderElement*, const AtomicString& name, double t);
+    bool pauseTransitionAtTime(RenderElement*, const String& property, double t);
     unsigned numberOfActiveAnimations(Document*) const;
 
-    PassRefPtr<RenderStyle> getAnimatedStyleForRenderer(RenderObject* renderer);
+    PassRefPtr<RenderStyle> getAnimatedStyleForRenderer(RenderElement* renderer);
 
     double beginAnimationUpdateTime();
     void setBeginAnimationUpdateTime(double t) { m_beginAnimationUpdateTime = t; }
@@ -108,7 +108,7 @@ public:
 
     void animationWillBeRemoved(AnimationBase*);
 
-    void updateAnimationTimerForRenderer(RenderObject*);
+    void updateAnimationTimerForRenderer(RenderElement*);
 
     bool allowsNewAnimationsWhileSuspended() const { return m_allowsNewAnimationsWhileSuspended; }
     void setAllowsNewAnimationsWhileSuspended(bool);
@@ -120,9 +120,7 @@ private:
     void fireEventsAndUpdateStyle();
     void startTimeResponse(double t);
 
-    typedef HashMap<RenderObject*, RefPtr<CompositeAnimation> > RenderObjectAnimationMap;
-
-    RenderObjectAnimationMap m_compositeAnimations;
+    HashMap<RenderElement*, RefPtr<CompositeAnimation>> m_compositeAnimations;
     Timer<AnimationControllerPrivate> m_animationTimer;
     Timer<AnimationControllerPrivate> m_updateStyleIfNeededDispatcher;
     Frame& m_frame;
index 57504e65d624c8e30207e3c965502e842f1b71e2..27b648370baf44e9071b5ee16080a47cf056264b 100644 (file)
@@ -282,11 +282,8 @@ static inline PassRefPtr<StyleImage> crossfadeBlend(const AnimationBase*, StyleC
     if (progress == 1)
         return toStyleImage;
 
-    CachedImage* fromCachedImage = static_cast<CachedImage*>(fromStyleImage->data());
-    CachedImage* toCachedImage = static_cast<CachedImage*>(toStyleImage->data());
-
-    RefPtr<CSSImageValue> fromImageValue = CSSImageValue::create(fromCachedImage->url(), fromStyleImage);
-    RefPtr<CSSImageValue> toImageValue = CSSImageValue::create(toCachedImage->url(), toStyleImage);
+    RefPtr<CSSImageValue> fromImageValue = CSSImageValue::create(fromStyleImage->cachedImage()->url(), fromStyleImage);
+    RefPtr<CSSImageValue> toImageValue = CSSImageValue::create(toStyleImage->cachedImage()->url(), toStyleImage);
     RefPtr<CSSCrossfadeValue> crossfadeValue = CSSCrossfadeValue::create(fromImageValue, toImageValue);
 
     crossfadeValue->setPercentage(CSSPrimitiveValue::create(progress, CSSPrimitiveValue::CSS_NUMBER));
index 9cbd1c5370ca23616b10b2b9337e19eaec5ecf41..58d2719dc6fd3cfd6ee5e4bb83293335da2d9852 100644 (file)
@@ -35,7 +35,7 @@
 #include "ImplicitAnimation.h"
 #include "KeyframeAnimation.h"
 #include "Logging.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include "RenderStyle.h"
 #include <wtf/text/CString.h>
 
@@ -80,7 +80,7 @@ void CompositeAnimation::clearRenderer()
     }
 }
 
-void CompositeAnimation::updateTransitions(RenderObject* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
+void CompositeAnimation::updateTransitions(RenderElement* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
 {
     // If currentStyle is null or there are no old or new transitions, just skip it
     if (!currentStyle || (!targetStyle->transitions() && m_transitions.isEmpty()))
@@ -203,7 +203,7 @@ void CompositeAnimation::updateTransitions(RenderObject* renderer, RenderStyle*
         m_transitions.remove(toBeRemoved[j]);
 }
 
-void CompositeAnimation::updateKeyframeAnimations(RenderObject* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
+void CompositeAnimation::updateKeyframeAnimations(RenderElement* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
 {
     // Nothing to do if we don't have any animations, and didn't have any before
     if (m_keyframeAnimations.isEmpty() && !targetStyle->hasAnimations())
@@ -295,7 +295,7 @@ void CompositeAnimation::updateKeyframeAnimations(RenderObject* renderer, Render
         m_keyframeAnimations.remove(animsToBeRemoved[j]);
 }
 
-PassRefPtr<RenderStyle> CompositeAnimation::animate(RenderObject* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
+PassRefPtr<RenderStyle> CompositeAnimation::animate(RenderElement* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle)
 {
     RefPtr<RenderStyle> resultStyle;
 
index 4f4919070c3247bb3870d7cff9a25b1cb9d6d7f9..15e905355b58eefddce5d2253fee1595557ab7e0 100644 (file)
@@ -39,11 +39,11 @@ namespace WebCore {
 
 class AnimationControllerPrivate;
 class AnimationController;
-class RenderObject;
+class RenderElement;
 class RenderStyle;
 
 // A CompositeAnimation represents a collection of animations that are running
-// on a single RenderObject, such as a number of properties transitioning at once.
+// on a single RenderElement, such as a number of properties transitioning at once.
 class CompositeAnimation : public RefCounted<CompositeAnimation> {
 public:
     static PassRefPtr<CompositeAnimation> create(AnimationControllerPrivate* animationController)
@@ -55,7 +55,7 @@ public:
     
     void clearRenderer();
 
-    PassRefPtr<RenderStyle> animate(RenderObject*, RenderStyle* currentStyle, RenderStyle* targetStyle);
+    PassRefPtr<RenderStyle> animate(RenderElement*, RenderStyle* currentStyle, RenderStyle* targetStyle);
     PassRefPtr<RenderStyle> getAnimatedStyle() const;
 
     double timeToNextService() const;
@@ -82,8 +82,8 @@ public:
 private:
     CompositeAnimation(AnimationControllerPrivate*);
 
-    void updateTransitions(RenderObject*, RenderStyle* currentStyle, RenderStyle* targetStyle);
-    void updateKeyframeAnimations(RenderObject*, RenderStyle* currentStyle, RenderStyle* targetStyle);
+    void updateTransitions(RenderElement*, RenderStyle* currentStyle, RenderStyle* targetStyle);
+    void updateKeyframeAnimations(RenderElement*, RenderStyle* currentStyle, RenderStyle* targetStyle);
     
     typedef HashMap<int, RefPtr<ImplicitAnimation> > CSSPropertyTransitionsMap;
     typedef HashMap<AtomicStringImpl*, RefPtr<KeyframeAnimation> >  AnimationNameMap;
index 368bc587ccc3a359f24f415e9aa60fbadc332135..f3446884672f8583635156dbc1693465e976e969 100644 (file)
@@ -38,7 +38,7 @@
 
 namespace WebCore {
 
-ImplicitAnimation::ImplicitAnimation(const Animation& transition, CSSPropertyID animatingProperty, RenderObject* renderer, CompositeAnimation* compAnim, RenderStyle* fromStyle)
+ImplicitAnimation::ImplicitAnimation(const Animation& transition, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compAnim, RenderStyle* fromStyle)
     : AnimationBase(transition, renderer, compAnim)
     , m_transitionProperty(transition.property())
     , m_animatingProperty(animatingProperty)
@@ -61,7 +61,7 @@ bool ImplicitAnimation::shouldSendEventForListener(Document::ListenerType inList
     return m_object->document().hasListenerType(inListenerType);
 }
 
-void ImplicitAnimation::animate(CompositeAnimation*, RenderObject*, const RenderStyle*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle)
+void ImplicitAnimation::animate(CompositeAnimation*, RenderElement*, const RenderStyle*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle)
 {
     // If we get this far and the animation is done, it means we are cleaning up a just finished animation.
     // So just return. Everything is already all cleaned up.
@@ -125,7 +125,7 @@ void ImplicitAnimation::pauseAnimation(double timeOffset)
 #endif
     // Restore the original (unanimated) style
     if (!paused())
-        setNeedsStyleRecalc(m_object->node());
+        setNeedsStyleRecalc(m_object->element());
 }
 
 void ImplicitAnimation::endAnimation()
@@ -160,9 +160,7 @@ bool ImplicitAnimation::sendTransitionEvent(const AtomicString& eventType, doubl
             String propertyName = getPropertyNameString(m_animatingProperty);
                 
             // Dispatch the event
-            RefPtr<Element> element = 0;
-            if (m_object->node() && m_object->node()->isElementNode())
-                element = toElement(m_object->node());
+            RefPtr<Element> element = m_object->element();
 
             ASSERT(!element || !element->document().inPageCache());
             if (!element)
index edf8a815b40613500d793d490fe6927528583bea..bf471ce7064020a8e8c605aba689f340f3511fb9 100644 (file)
 
 namespace WebCore {
 
+class RenderElement;
+
 // An ImplicitAnimation tracks the state of a transition of a specific CSS property
-// for a single RenderObject.
+// for a single RenderElement.
 class ImplicitAnimation : public AnimationBase {
 public:
-    static PassRefPtr<ImplicitAnimation> create(const Animation& animation, CSSPropertyID animatingProperty, RenderObject* renderer, CompositeAnimation* compositeAnimation, RenderStyle* fromStyle)
+    static PassRefPtr<ImplicitAnimation> create(const Animation& animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* fromStyle)
     {
         return adoptRef(new ImplicitAnimation(animation, animatingProperty, renderer, compositeAnimation, fromStyle));
     };
@@ -52,7 +54,7 @@ public:
     virtual void pauseAnimation(double /*timeOffset*/);
     virtual void endAnimation();
 
-    virtual void animate(CompositeAnimation*, RenderObject*, const RenderStyle* currentStyle, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle);
+    virtual void animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle);
     virtual void getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle);
     virtual void reset(RenderStyle* to);
 
@@ -82,7 +84,7 @@ protected:
 #endif
 
 private:
-    ImplicitAnimation(const Animation&, CSSPropertyID, RenderObject*, CompositeAnimation*, RenderStyle*);
+    ImplicitAnimation(const Animation&, CSSPropertyID, RenderElement*, CompositeAnimation*, RenderStyle*);
     virtual ~ImplicitAnimation();
 
     CSSPropertyID m_transitionProperty; // Transition property as specified in the RenderStyle.
index baf2fe47f817368f65728a79f05ec0050794b9a2..27c5143b5c388a9360cd2687649e1185f2537b0c 100644 (file)
@@ -42,16 +42,16 @@ using namespace std;
 
 namespace WebCore {
 
-KeyframeAnimation::KeyframeAnimation(const Animation& animation, RenderObject* renderer, int index, CompositeAnimation* compAnim, RenderStyle* unanimatedStyle)
+KeyframeAnimation::KeyframeAnimation(const Animation& animation, RenderElement* renderer, int index, CompositeAnimation* compAnim, RenderStyle* unanimatedStyle)
     : AnimationBase(animation, renderer, compAnim)
-    , m_keyframes(renderer, animation.name())
+    , m_keyframes(animation.name())
     , m_index(index)
     , m_startEventDispatched(false)
     , m_unanimatedStyle(unanimatedStyle)
 {
     // Get the keyframe RenderStyles
-    if (m_object && m_object->node() && m_object->node()->isElementNode())
-        m_object->document().ensureStyleResolver().keyframeStylesForAnimation(toElement(m_object->node()), unanimatedStyle, m_keyframes);
+    if (m_object && m_object->element())
+        m_object->document().ensureStyleResolver().keyframeStylesForAnimation(m_object->element(), unanimatedStyle, m_keyframes);
 
     // Update the m_transformFunctionListValid flag based on whether the function lists in the keyframes match.
     validateTransformFunctionList();
@@ -139,7 +139,7 @@ void KeyframeAnimation::fetchIntervalEndpointsForProperty(CSSPropertyID property
     prog = progress(scale, offset, timingFunction);
 }
 
-void KeyframeAnimation::animate(CompositeAnimation* compositeAnimation, RenderObject*, const RenderStyle*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle)
+void KeyframeAnimation::animate(CompositeAnimation* compositeAnimation, RenderElement*, const RenderStyle*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle)
 {
     // Fire the start timeout if needed
     fireAnimationEventsIfNeeded();
@@ -251,7 +251,7 @@ void KeyframeAnimation::pauseAnimation(double timeOffset)
 #endif
     // Restore the original (unanimated) style
     if (!paused())
-        setNeedsStyleRecalc(m_object->node());
+        setNeedsStyleRecalc(m_object->element());
 }
 
 void KeyframeAnimation::endAnimation()
@@ -265,7 +265,7 @@ void KeyframeAnimation::endAnimation()
 #endif
     // Restore the original (unanimated) style
     if (!paused())
-        setNeedsStyleRecalc(m_object->node());
+        setNeedsStyleRecalc(m_object->element());
 }
 
 bool KeyframeAnimation::shouldSendEventForListener(Document::ListenerType listenerType) const
@@ -309,9 +309,7 @@ bool KeyframeAnimation::sendAnimationEvent(const AtomicString& eventType, double
 
     if (shouldSendEventForListener(listenerType)) {
         // Dispatch the event
-        RefPtr<Element> element;
-        if (m_object->node() && m_object->node()->isElementNode())
-            element = toElement(m_object->node());
+        RefPtr<Element> element = m_object->element();
 
         ASSERT(!element || !element->document().inPageCache());
         if (!element)
index b215d92cb641276a32f807df3e6d9d595a950f40..470b1909b7c972220a2f984fde5f52642e0a3140 100644 (file)
@@ -37,17 +37,16 @@ namespace WebCore {
 
 class RenderStyle;
 
-// A KeyframeAnimation tracks the state of an explicit animation
-// for a single RenderObject.
-class KeyframeAnimation : public AnimationBase {
+// A KeyframeAnimation tracks the state of an explicit animation for a single RenderElement.
+class KeyframeAnimation FINAL : public AnimationBase {
 public:
-    static PassRefPtr<KeyframeAnimation> create(const Animation& animation, RenderObject* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
+    static RefPtr<KeyframeAnimation> create(const Animation& animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
     {
         return adoptRef(new KeyframeAnimation(animation, renderer, index, compositeAnimation, unanimatedStyle));
-    };
+    }
 
-    virtual void animate(CompositeAnimation*, RenderObject*, const RenderStyle* currentStyle, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle);
-    virtual void getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle);
+    virtual void animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) OVERRIDE;
+    virtual void getAnimatedStyle(RefPtr<RenderStyle>&) OVERRIDE;
 
     const KeyframeList& keyframes() const { return m_keyframes; }
 
@@ -60,23 +59,23 @@ public:
     void setUnanimatedStyle(PassRefPtr<RenderStyle> style) { m_unanimatedStyle = style; }
     RenderStyle* unanimatedStyle() const { return m_unanimatedStyle.get(); }
 
-    virtual double timeToNextService();
+    virtual double timeToNextService() OVERRIDE;
 
 protected:
-    virtual void onAnimationStart(double elapsedTime);
-    virtual void onAnimationIteration(double elapsedTime);
-    virtual void onAnimationEnd(double elapsedTime);
-    virtual bool startAnimation(double timeOffset);
-    virtual void pauseAnimation(double timeOffset);
-    virtual void endAnimation();
+    virtual void onAnimationStart(double elapsedTime) OVERRIDE;
+    virtual void onAnimationIteration(double elapsedTime) OVERRIDE;
+    virtual void onAnimationEnd(double elapsedTime) OVERRIDE;
+    virtual bool startAnimation(double timeOffset) OVERRIDE;
+    virtual void pauseAnimation(double timeOffset) OVERRIDE;
+    virtual void endAnimation() OVERRIDE;
 
-    virtual void overrideAnimations();
-    virtual void resumeOverriddenAnimations();
+    virtual void overrideAnimations() OVERRIDE;
+    virtual void resumeOverriddenAnimations() OVERRIDE;
 
     bool shouldSendEventForListener(Document::ListenerType inListenerType) const;
     bool sendAnimationEvent(const AtomicString&, double elapsedTime);
 
-    virtual bool affectsProperty(CSSPropertyID) const;
+    virtual bool affectsProperty(CSSPropertyID) const OVERRIDE;
 
     void validateTransformFunctionList();
 #if ENABLE(CSS_FILTERS)
@@ -84,7 +83,7 @@ protected:
 #endif
 
 private:
-    KeyframeAnimation(const Animation&, RenderObject*, int index, CompositeAnimation*, RenderStyle* unanimatedStyle);
+    KeyframeAnimation(const Animation&, RenderElement*, int index, CompositeAnimation*, RenderStyle* unanimatedStyle);
     virtual ~KeyframeAnimation();
     
     // Get the styles for the given property surrounding the current animation time and the progress between them.
index 9062cb1c7152e469a40d54124237280c2b8f5325..8ec9560cd74e1430e94cdda044777a29200e5b8e 100644 (file)
@@ -138,7 +138,7 @@ void EventHandler::focusDocumentView()
 bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
 {
     // Figure out which view to send the event to.
-    RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
+    auto target = event.targetNode() ? event.targetNode()->renderer() : 0;
     if (!target || !target->isWidget())
         return false;
     
@@ -356,7 +356,7 @@ bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& eve
             Node* node = event.targetNode();
             if (!node)
                 return false;
-            RenderObject* renderer = node->renderer();
+            auto renderer = node->renderer();
             if (!renderer || !renderer->isWidget())
                 return false;
             Widget* widget = toRenderWidget(renderer)->widget();
index 4c886ebd4643dbe534167d06d931ecc15b02f9aa..29ec77e14fe4812ecf7cabf3d1f97529faefaad4 100644 (file)
@@ -135,7 +135,7 @@ NSImage* snapshotDragImage(Frame* frame, Node* node, NSRect* imageRect, NSRect*
                                         // imply new styles, plus JS could have changed other things
 
 
-    // Document::updateLayout may have blown away the original RenderObject.
+    // Document::updateLayout may have blown away the original RenderElement.
     renderer = node->renderer();
     if (!renderer)
         return nil;
index 0c84f8a982591b7348e9f20a4663521d50db7b9e..f9351a70acfee1a4fa391021921e2d70658b36db 100644 (file)
@@ -52,8 +52,8 @@
 #if DRAW_FRAME_RATE
 #import "Font.h"
 #import "Document.h"
-#import "RenderObject.h"
 #import "RenderStyle.h"
+#import "RenderView.h"
 #endif
 
 SOFT_LINK_FRAMEWORK(QTKit)
@@ -1352,10 +1352,10 @@ void MediaPlayerPrivateQTKit::paint(GraphicsContext* context, const IntRect& r)
 #if DRAW_FRAME_RATE
     // Draw the frame rate only after having played more than 10 frames.
     if (m_frameCountWhilePlaying > 10) {
-        Frame* frame = m_player->frameView() ? &m_player->frameView()->frame() : NULL;
-        Document* document = frame ? frame->document() : NULL;
-        RenderObject* renderer = document ? document->renderView() : NULL;
-        RenderStyle* styleToUse = renderer ? renderer->style() : NULL;
+        Frame* frame = m_player->frameView() ? &m_player->frameView()->frame() : nullptr;
+        Document* document = frame ? frame->document() : nullptr;
+        auto renderer = document ? document->renderView() : nullptr;
+        RenderStyle* styleToUse = renderer ? renderer->style() : nullptr;
         if (styleToUse) {
             double frameRate = (m_frameCountWhilePlaying - 1) / ( m_startedPlaying ? ([NSDate timeIntervalSinceReferenceDate] - m_timeStartedPlaying) :
                 (m_timeStoppedPlaying - m_timeStartedPlaying) );
index 09f0175e583fc2e09997d48a008dd055765f79d9..bf1ad91ebf8be2e6870ae549177afd9f6ca7f6a1 100644 (file)
 #include "CounterNode.h"
 
 #include "RenderCounter.h"
-#include "RenderObject.h"
+#include "RenderElement.h"
 #include <stdio.h>
 
 namespace WebCore {
 
-CounterNode::CounterNode(RenderObject* o, bool hasResetType, int value)
+CounterNode::CounterNode(RenderElement* o, bool hasResetType, int value)
     : m_hasResetType(hasResetType)
     , m_value(value)
     , m_countInParent(0)
@@ -90,7 +90,7 @@ CounterNode::~CounterNode()
     resetRenderers();
 }
 
-PassRefPtr<CounterNode> CounterNode::create(RenderObject* owner, bool hasResetType, int value)
+PassRefPtr<CounterNode> CounterNode::create(RenderElement* owner, bool hasResetType, int value)
 {
     return adoptRef(new CounterNode(owner, hasResetType, value));
 }
index 7d6def81bdb7b7a36a97c0cb0c3be91e519b2dd8..a5397ecc01883bfc5f030041efca94a2d3a7d99b 100644 (file)
 
 namespace WebCore {
 
-class RenderObject;
 class RenderCounter;
+class RenderElement;
 
 class CounterNode : public RefCounted<CounterNode> {
 public:
-    static PassRefPtr<CounterNode> create(RenderObject*, bool isReset, int value);
+    static PassRefPtr<CounterNode> create(RenderElement*, bool isReset, int value);
     ~CounterNode();
     bool actsAsReset() const { return m_hasResetType || !m_parent; }
     bool hasResetType() const { return m_hasResetType; }
     int value() const { return m_value; }
     int countInParent() const { return m_countInParent; }
-    RenderObject* owner() const { return m_owner; }
+    RenderElement* owner() const { return m_owner; }
     void addRenderer(RenderCounter*);
     void removeRenderer(RenderCounter*);
 
@@ -71,7 +71,7 @@ public:
     void removeChild(CounterNode*);
 
 private:
-    CounterNode(RenderObject*, bool isReset, int value);
+    CounterNode(RenderElement*, bool isReset, int value);
     int computeCountInParent() const;
     // Invalidates the text in the renderer of this counter, if any,
     // and in the renderers of all descendants of this counter, if any.
@@ -81,7 +81,7 @@ private:
     bool m_hasResetType;
     int m_value;
     int m_countInParent;
-    RenderObject* m_owner;
+    RenderElement* m_owner;
     RenderCounter* m_rootRenderer;
 
     CounterNode* m_parent;
index b06bd4e47f212b4e333fcb0ee5affe4979969662..1da7f04e643c2dfc1459e17bc759e1fce58c2a66 100644 (file)
@@ -123,7 +123,7 @@ GraphicsContext* FilterEffectRenderer::inputContext()
     return sourceImage() ? sourceImage()->context() : 0;
 }
 
-PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* filterOperation)
+PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderElement* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* filterOperation)
 {
 #if ENABLE(SVG)
     if (!renderer)
@@ -146,7 +146,7 @@ PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject
     if (!filter) {
         // Although we did not find the referenced filter, it might exist later
         // in the document
-        document->accessSVGExtensions()->addPendingResource(filterOperation->fragment(), toElement(renderer->node()));
+        document->accessSVGExtensions()->addPendingResource(filterOperation->fragment(), renderer->element());
         return 0;
     }
 
@@ -179,7 +179,7 @@ PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderObject
 #endif
 }
 
-bool FilterEffectRenderer::build(RenderObject* renderer, const FilterOperations& operations, FilterConsumer consumer)
+bool FilterEffectRenderer::build(RenderElement* renderer, const FilterOperations& operations, FilterConsumer consumer)
 {
 #if ENABLE(CSS_SHADERS)
     m_hasCustomShaderFilter = false;
index a0f47c27c9cc6f0e46c775fabd75275318f52ab7..3422f33d62ab2689f7f781d1fc5ad9b490beba76 100644 (file)
 #include "LayoutRect.h"
 #include "SVGFilterBuilder.h"
 #include "SourceGraphic.h"
-
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-typedef Vector<RefPtr<FilterEffect> > FilterEffectList;
 class CachedShader;
 class CustomFilterProgram;
 class Document;
 class GraphicsContext;
+class RenderElement;
 class RenderLayer;
-class RenderObject;
+
+typedef Vector<RefPtr<FilterEffect>> FilterEffectList;
 
 enum FilterConsumer {
     FilterProperty,
@@ -77,6 +77,7 @@ public:
     GraphicsContext* filterContext() const;
 
     const LayoutRect& repaintRect() const { return m_repaintRect; }
+
 private:
     RenderLayer* m_renderLayer; // FIXME: this is mainly used to get the FilterEffectRenderer. FilterEffectRendererHelper should be weaned off it.
     LayoutPoint m_paintOffset;
@@ -85,32 +86,31 @@ private:
     bool m_startedFilterEffect;
 };
 
-class FilterEffectRenderer : public Filter
-{
+class FilterEffectRenderer FINAL : public Filter {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<FilterEffectRenderer> create()
+    static RefPtr<FilterEffectRenderer> create()
     {
-        return adoptRef(new FilterEffectRenderer());
+        return adoptRef(new FilterEffectRenderer);
     }
 
-    virtual void setSourceImageRect(const FloatRect& sourceImageRect)
+    void setSourceImageRect(const FloatRect& sourceImageRect)
     { 
         m_sourceDrawingRegion = sourceImageRect;
         setMaxEffectRects(sourceImageRect);
         setFilterRegion(sourceImageRect);
         m_graphicsBufferAttached = false;
     }
-    virtual FloatRect sourceImageRect() const { return m_sourceDrawingRegion; }
+    virtual FloatRect sourceImageRect() const OVERRIDE { return m_sourceDrawingRegion; }
 
-    virtual void setFilterRegion(const FloatRect& filterRegion) { m_filterRegion = filterRegion; }
-    virtual FloatRect filterRegion() const { return m_filterRegion; }
+    void setFilterRegion(const FloatRect& filterRegion) { m_filterRegion = filterRegion; }
+    virtual FloatRect filterRegion() const OVERRIDE { return m_filterRegion; }
 
     GraphicsContext* inputContext();
     ImageBuffer* output() const { return lastEffect()->asImageBuffer(); }
 
-    bool build(RenderObject* renderer, const FilterOperations&, FilterConsumer);
-    PassRefPtr<FilterEffect> buildReferenceFilter(RenderObject* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation*);
+    bool build(RenderElement*, const FilterOperations&, FilterConsumer);
+    PassRefPtr<FilterEffect> buildReferenceFilter(RenderElement*, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation*);
     bool updateBackingStoreRect(const FloatRect& filterRect);
     void allocateBackingStoreIfNeeded();
     void clearIntermediateResults();
@@ -124,6 +124,7 @@ public:
 #if ENABLE(CSS_SHADERS)
     bool hasCustomShaderFilter() const { return m_hasCustomShaderFilter; }
 #endif
+
 private:
     void setMaxEffectRects(const FloatRect& effectRect)
     {
@@ -132,11 +133,12 @@ private:
             effect->setMaxEffectRect(effectRect);
         }
     }
-    PassRefPtr<FilterEffect> lastEffect() const
+
+    FilterEffect* lastEffect() const
     {
-        if (m_effects.size() > 0)
-            return m_effects.last();
-        return 0;
+        if (!m_effects.isEmpty())
+            return m_effects.last().get();
+        return nullptr;
     }
 
     FilterEffectRenderer();
index 8692c8ecf527169b7a14f8e9c9d2b803999058b4..b9a27cb035e24a2bf307fa40a65fd755f18386fd 100644 (file)
@@ -200,7 +200,7 @@ String HitTestResult::spellingToolTip(TextDirection& dir) const
     if (!marker)
         return String();
 
-    if (RenderObject* renderer = m_innerNonSharedNode->renderer())
+    if (auto renderer = m_innerNonSharedNode->renderer())
         dir = renderer->style()->direction();
     return marker->description();
 }
@@ -228,7 +228,7 @@ String HitTestResult::title(TextDirection& dir) const
         if (titleNode->isElementNode()) {
             String title = toElement(titleNode)->title();
             if (!title.isEmpty()) {
-                if (RenderObject* renderer = titleNode->renderer())
+                if (auto renderer = titleNode->renderer())
                     dir = renderer->style()->direction();
                 return title;
             }
@@ -243,7 +243,7 @@ String HitTestResult::innerTextIfTruncated(TextDirection& dir) const
         if (!truncatedNode->isElementNode())
             continue;
 
-        if (RenderObject* renderer = truncatedNode->renderer()) {
+        if (auto renderer = toElement(truncatedNode)->renderer()) {
             if (renderer->isRenderBlock()) {
                 RenderBlock* block = toRenderBlock(renderer);
                 if (block->style()->textOverflow()) {
@@ -293,7 +293,7 @@ Image* HitTestResult::image() const
     if (!m_innerNonSharedNode)
         return 0;
     
-    RenderObject* renderer = m_innerNonSharedNode->renderer();
+    auto renderer = m_innerNonSharedNode->renderer();
     if (renderer && renderer->isImage()) {
         RenderImage* image = static_cast<WebCore::RenderImage*>(renderer);
         if (image->cachedImage() && !image->cachedImage()->errorOccurred())
index 205ad4ab8d206410e8b65cf495306aeb7facb2e8..8d5ebdb11dce0b395941d0854676ff1d6bcc15ec 100644 (file)
 #include "config.h"
 #include "LayoutRepainter.h"
 
-#include "RenderObject.h"
+#include "RenderElement.h"
 
 namespace WebCore {
 
-LayoutRepainter::LayoutRepainter(RenderObject& object, bool checkForRepaint)
+LayoutRepainter::LayoutRepainter(RenderElement& object, bool checkForRepaint)
     : m_object(object)
     , m_repaintContainer(0)
     , m_checkForRepaint(checkForRepaint)
index 0658ea853c20ea5c371db1c435a7c46adc815226..cae8f10202220776fe6a945eeda958101faaf081 100644 (file)
 
 namespace WebCore {
 
+class RenderElement;
 class RenderLayerModelObject;
-class RenderObject;
 
 class LayoutRepainter {
 public:
-    LayoutRepainter(RenderObject&, bool checkForRepaint);
+    LayoutRepainter(RenderElement&, bool checkForRepaint);
 
     bool checkForRepaint() const { return m_checkForRepaint; }
 
@@ -43,7 +43,7 @@ public:
     bool repaintAfterLayout();
 
 private:
-    RenderObject& m_object;
+    RenderElement& m_object;
     RenderLayerModelObject* m_repaintContainer;
     // We store these values as LayoutRects, but the final invalidations will be pixel snapped
     LayoutRect m_oldBounds;
index 492a7535dabe415105b559c5c033143a3abed608..0baeb7d19965ee7b079bbef9c0a6c9ce2b83a524 100644 (file)
@@ -37,11 +37,10 @@ class RenderArena;
 class RenderBlock;
 class RenderBlockFlow;
 class RenderBox;
-class RenderObject;
+class RenderElement;
 class RenderFlowThread;
-#if ENABLE(CSS_SHAPES)
+class RenderObject;
 class ShapeInsideInfo;
-#endif
 
 class LayoutState {
     WTF_MAKE_NONCOPYABLE(LayoutState);
@@ -54,15 +53,15 @@ public:
         , m_layoutDeltaXSaturated(false)
         , m_layoutDeltaYSaturated(false)
 #endif
-        , m_columnInfo(0)
-        , m_lineGrid(0)
-        , m_next(0)
+        , m_columnInfo(nullptr)
+        , m_lineGrid(nullptr)
+        , m_next(nullptr)
 #if ENABLE(CSS_SHAPES)
-        , m_shapeInsideInfo(0)
+        , m_shapeInsideInfo(nullptr)
 #endif
         , m_pageLogicalHeight(0)
 #ifndef NDEBUG
-        , m_renderer(0)
+        , m_renderer(nullptr)
 #endif
     {
     }
@@ -113,14 +112,15 @@ private:
 
 public:
     // Do not add anything apart from bitfields until after m_columnInfo. See https://bugs.webkit.org/show_bug.cgi?id=100173
-    bool m_clipped:1;
-    bool m_isPaginated:1;
+    bool m_clipped : 1;
+    bool m_isPaginated : 1;
     // If our page height has changed, this will force all blocks to relayout.
-    bool m_pageLogicalHeightChanged:1;
+    bool m_pageLogicalHeightChanged : 1;
 #if !ASSERT_DISABLED && ENABLE(SATURATED_LAYOUT_ARITHMETIC)
-    bool m_layoutDeltaXSaturated:1;
-    bool m_layoutDeltaYSaturated:1;
+    bool m_layoutDeltaXSaturated : 1;
+    bool m_layoutDeltaYSaturated : 1;
 #endif
+
     // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation.
     ColumnInfo* m_columnInfo;
     // The current line grid that we're snapping to and the offset of the start of the grid.
index d00b1cd1e8ac229d3662282d14ea872a08aacfa5..ba5a6e9f9432d175f7258c234c7b9208bfe3ccc2 100644 (file)
 namespace WebCore {
 
 class FloatingObject;
-struct LineSegment;
 class RenderBlock;
 class RenderObject;
 class RenderRubyRun;
 
+struct LineSegment;
+
 enum IndentTextOrNot { DoNotIndentText, IndentText };
 
 class LineWidth {
index 658e02285ab2a64053512f6546e1af27bfa7c5de..b9a26cc981fb5048ce375987d9194dba9afa6e9c 100644 (file)
@@ -25,7 +25,7 @@
 
 namespace WebCore {
 
-static inline bool isContainingBlockCandidateForAbsolutelyPositionedObject(RenderObject* object)
+static inline bool isContainingBlockCandidateForAbsolutelyPositionedObject(RenderElement* object)
 {
     return object->style()->position() != StaticPosition
         || (object->hasTransform() && object->isRenderBlock())
@@ -35,29 +35,29 @@ static inline bool isContainingBlockCandidateForAbsolutelyPositionedObject(Rende
         || object->isRenderView();
 }
 
-static inline bool isNonRenderBlockInline(RenderObject* object)
+static inline bool isNonRenderBlockInline(RenderElement* object)
 {
     return (object->isInline() && !object->isReplaced()) || !object->isRenderBlock();
 }
 
-static inline RenderObject* containingBlockForFixedPosition(RenderObject* parent)
+static inline RenderElement* containingBlockForFixedPosition(RenderElement* parent)
 {
-    RenderObject* object = parent;
+    RenderElement* object = parent;
     while (object && !object->canContainFixedPositionObjects())
         object = object->parent();
     ASSERT(!object || !object->isAnonymousBlock());
     return object;
 }
 
-static inline RenderObject* containingBlockForAbsolutePosition(RenderObject* parent)
+static inline RenderElement* containingBlockForAbsolutePosition(RenderElement* parent)
 {
-    RenderObject* object = parent;
+    RenderElement* object = parent;
     while (object && !isContainingBlockCandidateForAbsolutelyPositionedObject(object))
         object = object->parent();
 
     // For a relatively positioned inline, return its nearest non-anonymous containing block,
     // not the inline itself, to avoid having a positioned objects list in all RenderInlines
-    // and use RenderBlock* as RenderObject::containingBlock's return type.
+    // and use RenderBlock* as RenderElement::containingBlock's return type.
     // Use RenderBlock::container() to obtain the inline.
     if (object && object->isRenderInline())
         object = object->containingBlock();
@@ -68,9 +68,9 @@ static inline RenderObject* containingBlockForAbsolutePosition(RenderObject* par
     return object;
 }
 
-static inline RenderObject* containingBlockForObjectInFlow(RenderObject* parent)
+static inline RenderElement* containingBlockForObjectInFlow(RenderElement* parent)
 {
-    RenderObject* object = parent;
+    RenderElement* object = parent;
     while (object && isNonRenderBlockInline(object))
         object = object->parent();
     return object;
@@ -136,7 +136,7 @@ public:
     explicit LogicalSelectionOffsetCaches(RenderBlock* rootBlock)
     {
         ASSERT(rootBlock->isSelectionRoot());
-        RenderObject* parent = rootBlock->parent();
+        auto parent = rootBlock->parent();
 
         // LogicalSelectionOffsetCaches should not be used on an orphaned tree.
         m_containingBlockForFixedPosition.setBlock(toRenderBlock(containingBlockForFixedPosition(parent)), 0);
index e670a776f44d5abfaaf66bfae81ad46337743fef..82247490086b495adac63fef3edf0dafce3c31a1 100644 (file)
@@ -54,8 +54,8 @@ typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap;
  */
 struct PaintInfo {
     PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase newPhase, PaintBehavior newPaintBehavior,
-        RenderObject* newSubtreePaintRoot = 0, RenderRegion* region = 0, ListHashSet<RenderInline*>* newOutlineObjects = 0,
-        OverlapTestRequestMap* overlapTestRequests = 0, const RenderLayerModelObject* newPaintContainer = 0)
+        RenderObject* newSubtreePaintRoot = nullptr, RenderRegion* region = nullptr, ListHashSet<RenderInline*>* newOutlineObjects = nullptr,
+        OverlapTestRequestMap* overlapTestRequests = nullptr, const RenderLayerModelObject* newPaintContainer = nullptr)
         : context(newContext)
         , rect(newRect)
         , phase(newPhase)
@@ -73,9 +73,9 @@ struct PaintInfo {
         if (!subtreePaintRoot)
             return;
 
-        // If we're the painting root, kids draw normally, and see root of 0.
+        // If we're the painting root, kids draw normally, and see root of nullptr.
         if (subtreePaintRoot == renderer) {
-            subtreePaintRoot = 0; 
+            subtreePaintRoot = nullptr;
             return;
         }
     }
index c60970816aa918e9308315b4ff12f0ed58fc4bd8..48f557f33c069097fd3efa9064991effd0d8e914 100644 (file)
@@ -1457,7 +1457,7 @@ LayoutRect RenderBox::maskClipRect()
 }
 
 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect,
-    BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
+    BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderElement* backgroundObject)
 {
     Vector<const FillLayer*, 8> layers;
     const FillLayer* curLayer = fillLayer;
@@ -1496,7 +1496,7 @@ void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons
 }
 
 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect,
-    BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
+    BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderElement* backgroundObject)
 {
     paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, LayoutSize(), op, backgroundObject);
 }
index a208992303460cf21bd7bb46ccade0754b951b5a..23c8c6473ed5aad445e0a68e9a3c2250236c5963 100644 (file)
@@ -611,8 +611,8 @@ protected:
 
     void paintBackground(const PaintInfo&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone);
     
-    void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
-    void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
+    void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderElement* backgroundObject);
+    void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderElement* backgroundObject = nullptr);
 
     void paintMaskImages(const PaintInfo&, const LayoutRect&);
 
index 8c06781f7c40f9f8a3f97011a808890acd481d3d..b25132526d40dda364d878cc0faac7d708527c50 100644 (file)
@@ -569,7 +569,7 @@ static void applyBoxShadowForBackground(GraphicsContext* context, RenderStyle* s
 }
 
 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, const LayoutRect& rect,
-    BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSize& boxSize, CompositeOperator op, RenderObject* backgroundObject)
+    BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const LayoutSize& boxSize, CompositeOperator op, RenderElement* backgroundObject)
 {
     GraphicsContext* context = paintInfo.context;
     if (context->paintingDisabled() || rect.isEmpty())
@@ -795,7 +795,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
         geometry.clip(paintInfo.rect);
         if (!geometry.destRect().isEmpty()) {
             CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer->composite() : op;
-            RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
+            auto clientForBackgroundImage = backgroundObject ? backgroundObject : this;
             RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geometry.tileSize());
             context->setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance);
             bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.get(), bgLayer, geometry.tileSize());
@@ -1043,7 +1043,7 @@ static inline int getSpace(int areaSize, int tileSize)
 }
 
 void RenderBoxModelObject::calculateBackgroundImageGeometry(const RenderLayerModelObject* paintContainer, const FillLayer* fillLayer, const LayoutRect& paintRect,
-    BackgroundImageGeometry& geometry, RenderObject* backgroundObject) const
+    BackgroundImageGeometry& geometry, RenderElement* backgroundObject) const
 {
     LayoutUnit left = 0;
     LayoutUnit top = 0;
@@ -1111,7 +1111,7 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const RenderLayerMod
         positioningAreaSize = geometry.destRect().size();
     }
 
-    const RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
+    auto clientForBackgroundImage = backgroundObject ? backgroundObject : this;
     IntSize fillTileSize = calculateFillTileSize(fillLayer, positioningAreaSize);
     fillLayer->image()->setContainerSizeForRenderer(clientForBackgroundImage, fillTileSize, style()->effectiveZoom());
     geometry.setTileSize(fillTileSize);
index 757a37fe2ed6414dc23f3306bee9325245893d0d..9d066faf5586c6168fd80d08e5059f2fabcf1d86 100644 (file)
@@ -161,7 +161,7 @@ public:
     void paintBorder(const PaintInfo&, const LayoutRect&, const RenderStyle*, BackgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
     bool paintNinePieceImage(GraphicsContext*, const LayoutRect&, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
     void paintBoxShadow(const PaintInfo&, const LayoutRect&, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
-    void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutSize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
+    void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const LayoutSize& = LayoutSize(), CompositeOperator = CompositeSourceOver, RenderElement* backgroundObject = 0);
 
     virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox* = 0) const;
 
@@ -258,7 +258,7 @@ protected:
 
     LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const;
 
-    void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintContainer, const FillLayer*, const LayoutRect& paintRect, BackgroundImageGeometry&, RenderObject* = 0) const;
+    void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintContainer, const FillLayer*, const LayoutRect& paintRect, BackgroundImageGeometry&, RenderElement* = 0) const;
     void getBorderEdgeInfo(class BorderEdge[], const RenderStyle*, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
     bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const;
     bool borderObscuresBackground() const;
index 1f52253b589afc2a6e75dea7d9dae1e33bfea149..d02d37e276cff51b29634a09142508eb383288b7 100644 (file)
@@ -93,35 +93,32 @@ static inline bool areRenderersElementsSiblings(RenderObject* first, RenderObjec
 
 // This function processes the renderer tree in the order of the DOM tree
 // including pseudo elements as defined in CSS 2.1.
-static RenderObject* nextInPreOrder(const RenderObject* object, const Element* stayWithin, bool skipDescendants = false)
+static RenderElement* nextInPreOrder(const RenderElement* element, const Element* stayWithin, bool skipDescendants = false)
 {
-    Element* self = toElement(object->node());
+    Element* self = element->element();
     Element* next = skipDescendants ? ElementTraversal::nextIncludingPseudoSkippingChildren(self, stayWithin) : ElementTraversal::nextIncludingPseudo(self, stayWithin);
     while (next && !next->renderer())
         next = skipDescendants ? ElementTraversal::nextIncludingPseudoSkippingChildren(next, stayWithin) : ElementTraversal::nextIncludingPseudo(next, stayWithin);
     return next ? next->renderer() : 0;
 }
 
-static bool planCounter(RenderObject* object, const AtomicString& identifier, bool& isReset, int& value)
+static bool planCounter(RenderElement* object, const AtomicString& identifier, bool& isReset, int& value)
 {
     ASSERT(object);
 
-    // Real text nodes don't have their own style so they can't have counters.
-    // We can't even look at their styles or we'll see extra resets and increments!
-    if (object->isText())
-        return false;
-    Node* generatingNode = object->generatingNode();
     // We must have a generating node or else we cannot have a counter.
-    if (!generatingNode)
+    Element* generatingElement = object->generatingElement();
+    if (!generatingElement)
         return false;
+
     RenderStyle* style = object->style();
     ASSERT(style);
 
     switch (style->styleType()) {
     case NOPSEUDO:
-        // Sometimes nodes have more then one renderer. Only the first one gets the counter
+        // Sometimes elements have more then one renderer. Only the first one gets the counter
         // LayoutTests/http/tests/css/counter-crash.html
-        if (generatingNode->renderer() != object)
+        if (generatingElement->renderer() != object)
             return false;
         break;
     case BEFORE:
@@ -149,7 +146,7 @@ static bool planCounter(RenderObject* object, const AtomicString& identifier, bo
             isReset = false;
             return true;
         }
-        if (Node* e = object->node()) {
+        if (Element* e = object->element()) {
             if (e->hasTagName(olTag)) {
                 value = static_cast<HTMLOListElement*>(e)->start();
                 isReset = true;
@@ -299,8 +296,15 @@ static CounterNode* makeCounterNode(RenderObject* object, const AtomicString& id
 {
     ASSERT(object);
 
-    if (object->hasCounterNodeMap()) {
-        if (CounterMap* nodeMap = counterMaps().get(object)) {
+    // Real text nodes don't have their own style so they can't have counters.
+    // We can't even look at their styles or we'll see extra resets and increments!
+    if (object->isText())
+        return nullptr;
+
+    RenderElement* element = toRenderElement(object);
+
+    if (element->hasCounterNodeMap()) {
+        if (CounterMap* nodeMap = counterMaps().get(element)) {
             if (CounterNode* node = nodeMap->get(identifier))
                 return node;
         }
@@ -308,21 +312,21 @@ static CounterNode* makeCounterNode(RenderObject* object, const AtomicString& id
 
     bool isReset = false;
     int value = 0;
-    if (!planCounter(object, identifier, isReset, value) && !alwaysCreateCounter)
-        return 0;
+    if (!planCounter(element, identifier, isReset, value) && !alwaysCreateCounter)
+        return nullptr;
 
     RefPtr<CounterNode> newParent = 0;
     RefPtr<CounterNode> newPreviousSibling = 0;
-    RefPtr<CounterNode> newNode = CounterNode::create(object, isReset, value);
-    if (findPlaceForCounter(object, identifier, isReset, newParent, newPreviousSibling))
+    RefPtr<CounterNode> newNode = CounterNode::create(element, isReset, value);
+    if (findPlaceForCounter(element, identifier, isReset, newParent, newPreviousSibling))
         newParent->insertAfter(newNode.get(), newPreviousSibling.get(), identifier);
     CounterMap* nodeMap;
-    if (object->hasCounterNodeMap())
-        nodeMap = counterMaps().get(object);
+    if (element->hasCounterNodeMap())
+        nodeMap = counterMaps().get(element);
     else {
         nodeMap = new CounterMap;
-        counterMaps().set(object, adoptPtr(nodeMap));
-        object->setHasCounterNodeMap(true);
+        counterMaps().set(element, adoptPtr(nodeMap));
+        element->setHasCounterNodeMap(true);
     }
     nodeMap->set(identifier, newNode);
     if (newNode->parent())
@@ -330,9 +334,9 @@ static CounterNode* makeCounterNode(RenderObject* object, const AtomicString& id
     // Checking if some nodes that were previously counter tree root nodes
     // should become children of this node now.
     CounterMaps& maps = counterMaps();
-    Element* stayWithin = parentOrPseudoHostElement(object);
+    Element* stayWithin = parentOrPseudoHostElement(element);
     bool skipDescendants;
-    for (RenderObject* currentRenderer = nextInPreOrder(object, stayWithin); currentRenderer; currentRenderer = nextInPreOrder(currentRenderer, stayWithin, skipDescendants)) {
+    for (RenderElement* currentRenderer = nextInPreOrder(element, stayWithin); currentRenderer; currentRenderer = nextInPreOrder(currentRenderer, stayWithin, skipDescendants)) {
         skipDescendants = false;
         if (!currentRenderer->hasCounterNodeMap())
             continue;
@@ -393,7 +397,7 @@ bool RenderCounter::isCounter() const
 String RenderCounter::originalText() const
 {
     if (!m_counterNode) {
-        RenderObject* beforeAfterContainer = parent();
+        RenderElement* beforeAfterContainer = parent();
         while (true) {
             if (!beforeAfterContainer)
                 return String();
index 1a89f347cd4bd24a994b0080b22390e3c9f92bf3..a80e7dbf9198741f07d6fdc7a2027e343c4216fe 100644 (file)
@@ -92,7 +92,10 @@ RenderElement::~RenderElement()
             maskBoxImage->removeClient(this);
 
 #if ENABLE(CSS_SHAPES)
-        removeShapeImageClient(m_style->shapeInside());
+        if (auto shapeValue = m_style->shapeInside()) {
+            if (auto shapeImage = shapeValue->image())
+                shapeImage->removeClient(this);
+        }
 #endif
     }
 }
@@ -992,6 +995,8 @@ void RenderElement::willBeRemovedFromTree()
 
 void RenderElement::willBeDestroyed()
 {
+    animation().cancelAnimations(this);
+
     destroyLeftoverChildren();
 
     RenderObject::willBeDestroyed();
@@ -1005,12 +1010,13 @@ RenderElement* RenderElement::rendererForRootBackground()
         // to crawl around a render tree with potential :before/:after content and
         // anonymous blocks created by inline <body> tags etc. We can locate the <body>
         // render object very easily via the DOM.
-        HTMLElement* body = document().body();
-        RenderElement* bodyObject = (body && body->hasLocalName(HTMLNames::bodyTag)) ? body->renderer() : 0;
-        if (bodyObject)
-            return bodyObject;
+        if (auto body = document().body()) {
+            if (body->hasLocalName(HTMLNames::bodyTag)) {
+                if (auto renderer = body->renderer())
+                    return renderer;
+            }
+        }
     }
-
     return this;
 }
 
@@ -1029,11 +1035,9 @@ RenderElement* RenderElement::hoverAncestor() const
 
     if (hoverAncestor && hoverAncestor->isRenderNamedFlowThread()) {
         hoverAncestor = nullptr;
-
         if (Element* element = this->element()) {
-            ContainerNode* domAncestorNode = element->parentNode();
-            if (domAncestorNode)
-                hoverAncestor = toRenderElement(domAncestorNode->renderer());
+            if (auto parent = element->parentNode())
+                hoverAncestor = parent->renderer();
         }
     }
 
index 5fbfce690ade4acddef7b4ef4b8c22bfe7fdcd91..e082199180a59d8a7032cee26582951d0422d305 100644 (file)
@@ -192,7 +192,7 @@ inline RenderStyle* RenderObject::firstLineStyle() const
     return toRenderElement(this)->firstLineStyle();
 }
 
-inline RenderElement* Element::renderer() const
+inline RenderElement* ContainerNode::renderer() const
 {
     return toRenderElement(Node::renderer());
 }
index 70709c2c7b4340420ade7c6d229ad1e145194870..d11cbc9d7f56df056270178d0270784f4e23f6da 100644 (file)
@@ -44,7 +44,7 @@ RenderImageResource::~RenderImageResource()
 {
 }
 
-void RenderImageResource::initialize(RenderObject* renderer)
+void RenderImageResource::initialize(RenderElement* renderer)
 {
     ASSERT(!m_renderer);
     ASSERT(renderer);
index 2f7fb9ad51272af7ce2ed017dd66e2ec59ccce08..5339b32b9995a2233f73f51371db1c6f0743f5ff 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-class RenderObject;
+class RenderElement;
 
 class RenderImageResource {
     WTF_MAKE_NONCOPYABLE(RenderImageResource); WTF_MAKE_FAST_ALLOCATED;
@@ -45,7 +45,7 @@ public:
         return adoptPtr(new RenderImageResource);
     }
 
-    virtual void initialize(RenderObject*);
+    virtual void initialize(RenderElement*);
     virtual void shutdown();
 
     void setCachedImage(CachedImage*);
@@ -69,7 +69,7 @@ public:
 
 protected:
     RenderImageResource();
-    RenderObject* m_renderer;
+    RenderElement* m_renderer;
     CachedResourceHandle<CachedImage> m_cachedImage;
 
 private:
index 44efe2f988a73e5ca82d37b702c86626dee475f0..e5052f18f08879deab2b3b63a7e292590169ebf2 100644 (file)
@@ -44,7 +44,7 @@ RenderImageResourceStyleImage::~RenderImageResourceStyleImage()
 {
 }
 
-void RenderImageResourceStyleImage::initialize(RenderObject* renderer)
+void RenderImageResourceStyleImage::initialize(RenderElement* renderer)
 {
     RenderImageResource::initialize(renderer);
 
index f43ff722c7bb3e108e76fc513849c90f2e3b0f2d..f2e88cc57e21e05a95a681047316ca8d41309b59 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-class RenderObject;
+class RenderElement;
 
 class RenderImageResourceStyleImage : public RenderImageResource {
 public:
@@ -42,24 +42,25 @@ public:
     {
         return adoptPtr(new RenderImageResourceStyleImage(styleImage));
     }
-    virtual void initialize(RenderObject*);
-    virtual void shutdown();
 
-    virtual bool hasImage() const { return true; }
-    virtual PassRefPtr<Image> image(int width = 0, int height = 0) const;
-    virtual bool errorOccurred() const { return m_styleImage->errorOccurred(); }
+private:
+    virtual void initialize(RenderElement*) OVERRIDE;
+    virtual void shutdown() OVERRIDE;
+
+    virtual bool hasImage() const OVERRIDE { return true; }
+    virtual PassRefPtr<Image> image(int width = 0, int height = 0) const OVERRIDE;
+    virtual bool errorOccurred() const OVERRIDE { return m_styleImage->errorOccurred(); }
 
-    virtual void setContainerSizeForRenderer(const IntSize&);
-    virtual bool usesImageContainerSize() const { return m_styleImage->usesImageContainerSize(); }
-    virtual bool imageHasRelativeWidth() const { return m_styleImage->imageHasRelativeWidth(); }
-    virtual bool imageHasRelativeHeight() const { return m_styleImage->imageHasRelativeHeight(); }
+    virtual void setContainerSizeForRenderer(const IntSize&) OVERRIDE;
+    virtual bool usesImageContainerSize() const OVERRIDE { return m_styleImage->usesImageContainerSize(); }
+    virtual bool imageHasRelativeWidth() const OVERRIDE { return m_styleImage->imageHasRelativeWidth(); }
+    virtual bool imageHasRelativeHeight() const OVERRIDE { return m_styleImage->imageHasRelativeHeight(); }
 
     virtual LayoutSize imageSize(float multiplier) const OVERRIDE { return m_styleImage->imageSize(m_renderer, multiplier); }
     virtual LayoutSize intrinsicSize(float multiplier) const OVERRIDE { return m_styleImage->imageSize(m_renderer, multiplier); }
 
-    virtual WrappedImagePtr imagePtr() const { return m_styleImage->data(); }
+    virtual WrappedImagePtr imagePtr() const OVERRIDE { return m_styleImage->data(); }
 
-private:
     explicit RenderImageResourceStyleImage(StyleImage*);
     RefPtr<StyleImage> m_styleImage;
 };
index dd4fc7cfac1956997a35f6cba166b4d38a30d927..150f5055f110154239bc3bb6147b1db8e9fd67d9 100644 (file)
@@ -309,7 +309,7 @@ RenderLayerCompositor& RenderLayer::compositor() const
 void RenderLayer::contentChanged(ContentChangeType changeType)
 {
     // This can get called when video becomes accelerated, so the layers may change.
-    if ((changeType == CanvasChanged || changeType == VideoChanged || changeType == FullScreenChanged) && compositor().updateLayerCompositingState(this))
+    if ((changeType == CanvasChanged || changeType == VideoChanged || changeType == FullScreenChanged) && compositor().updateLayerCompositingState(*this))
         compositor().setCompositingLayersNeedRebuild();
 
     if (m_backing)
@@ -1164,7 +1164,7 @@ bool RenderLayer::updateDescendantClippingContext(bool addClipping)
         RenderLayerBacking* backing = child->backing();
         // Update layer context when new clipping is added or existing clipping is removed.
         if (backing && (addClipping || backing->hasAncestorClippingLayer())) {
-            if (backing->updateAncestorClippingLayer(compositor().clippedByAncestor(child)))
+            if (backing->updateAncestorClippingLayer(compositor().clippedByAncestor(*child)))
                 layerNeedsRebuild = true;
         }
 
@@ -1790,7 +1790,7 @@ void RenderLayer::addChild(RenderLayer* child, RenderLayer* beforeChild)
         setAncestorChainHasOutOfFlowPositionedDescendant(child->renderer().containingBlock());
 
 #if USE(ACCELERATED_COMPOSITING)
-    compositor().layerWasAdded(this, child);
+    compositor().layerWasAdded(*this, *child);
 #endif
 }
 
@@ -1798,7 +1798,7 @@ RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild)
 {
 #if USE(ACCELERATED_COMPOSITING)
     if (!renderer().documentBeingDestroyed())
-        compositor().layerWillBeRemoved(this, oldChild);
+        compositor().layerWillBeRemoved(*this, *oldChild);
 #endif
 
     // remove the child
@@ -1848,7 +1848,7 @@ void RenderLayer::removeOnlyThisLayer()
     renderer().setHasLayer(false);
 
 #if USE(ACCELERATED_COMPOSITING)
-    compositor().layerWillBeRemoved(m_parent, this);
+    compositor().layerWillBeRemoved(*m_parent, *this);
 #endif
 
     // Dirty the clip rects.
@@ -3214,7 +3214,7 @@ void RenderLayer::updateScrollInfoAfterLayout()
 
 #if USE(ACCELERATED_COMPOSITING)
     // Composited scrolling may need to be enabled or disabled if the amount of overflow changed.
-    if (compositor().updateLayerCompositingState(this))
+    if (compositor().updateLayerCompositingState(*this))
         compositor().setCompositingLayersNeedRebuild();
 #endif
 }
@@ -5597,7 +5597,7 @@ RenderLayerBacking* RenderLayer::ensureBacking()
 {
     if (!m_backing) {
         m_backing = adoptPtr(new RenderLayerBacking(this));
-        compositor().layerBecameComposited(this);
+        compositor().layerBecameComposited(*this);
 
 #if ENABLE(CSS_FILTERS)
         updateOrRemoveFilterEffectRenderer();
@@ -5612,7 +5612,7 @@ RenderLayerBacking* RenderLayer::ensureBacking()
 void RenderLayer::clearBacking(bool layerBeingDestroyed)
 {
     if (m_backing && !renderer().documentBeingDestroyed())
-        compositor().layerBecameNonComposited(this);
+        compositor().layerBecameNonComposited(*this);
     m_backing.clear();
 
 #if ENABLE(CSS_FILTERS)
@@ -5734,14 +5734,14 @@ void RenderLayer::setParent(RenderLayer* parent)
 
 #if USE(ACCELERATED_COMPOSITING)
     if (m_parent && !renderer().documentBeingDestroyed())
-        compositor().layerWillBeRemoved(m_parent, this);
+        compositor().layerWillBeRemoved(*m_parent, *this);
 #endif
     
     m_parent = parent;
     
 #if USE(ACCELERATED_COMPOSITING)
     if (m_parent && !renderer().documentBeingDestroyed())
-        compositor().layerWasAdded(m_parent, this);
+        compositor().layerWasAdded(*m_parent, *this);
 #endif
 }
 
@@ -6242,7 +6242,7 @@ void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
     updateNeedsCompositedScrolling();
 
     const RenderStyle* newStyle = renderer().style();
-    if (compositor().updateLayerCompositingState(this)
+    if (compositor().updateLayerCompositingState(*this)
         || needsCompositingLayersRebuiltForClip(oldStyle, newStyle)
         || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle))
         compositor().setCompositingLayersNeedRebuild();
index 6063af4e621a69b6d766ff87a339bebe4efe7bf3..c3c19b39b828b169d5a448ca28aa41b9a612ae10 100644 (file)
@@ -413,7 +413,7 @@ bool RenderLayerBacking::shouldClipCompositedBounds() const
 
 void RenderLayerBacking::updateCompositedBounds()
 {
-    LayoutRect layerBounds = compositor().calculateCompositedBounds(m_owningLayer, m_owningLayer);
+    LayoutRect layerBounds = compositor().calculateCompositedBounds(*m_owningLayer, *m_owningLayer);
 
     // Clip to the size of the document or enclosing overflow-scroll layer.
     // If this or an ancestor is transformed, we can't currently compute the correct rect to intersect with.
@@ -472,14 +472,14 @@ void RenderLayerBacking::updateAfterLayout(UpdateAfterLayoutFlags flags)
         // The solution is to update compositing children of this layer here,
         // via updateCompositingChildrenGeometry().
         updateCompositedBounds();
-        compositor().updateCompositingDescendantGeometry(m_owningLayer, m_owningLayer, flags & CompositingChildrenOnly);
+        compositor().updateCompositingDescendantGeometry(*m_owningLayer, *m_owningLayer, flags & CompositingChildrenOnly);
         
         if (flags & IsUpdateRoot) {
             updateGraphicsLayerGeometry();
             compositor().updateRootLayerPosition();
             RenderLayer* stackingContainer = m_owningLayer->enclosingStackingContainer();
             if (!compositor().compositingLayersNeedRebuild() && stackingContainer && (stackingContainer != m_owningLayer))
-                compositor().updateCompositingDescendantGeometry(stackingContainer, stackingContainer, flags & CompositingChildrenOnly);
+                compositor().updateCompositingDescendantGeometry(*stackingContainer, *stackingContainer, flags & CompositingChildrenOnly);
         }
     }
     
@@ -493,22 +493,22 @@ bool RenderLayerBacking::updateGraphicsLayerConfiguration()
     m_owningLayer->updateZOrderLists();
 
     bool layerConfigChanged = false;
-    setBackgroundLayerPaintsFixedRootBackground(compositor().needsFixedRootBackgroundLayer(m_owningLayer));
+    setBackgroundLayerPaintsFixedRootBackground(compositor().needsFixedRootBackgroundLayer(*m_owningLayer));
     
     // The background layer is currently only used for fixed root backgrounds.
     if (updateBackgroundLayer(m_backgroundLayerPaintsFixedRootBackground))
         layerConfigChanged = true;
 
-    if (updateForegroundLayer(compositor().needsContentsCompositingLayer(m_owningLayer)))
+    if (updateForegroundLayer(compositor().needsContentsCompositingLayer(*m_owningLayer)))
         layerConfigChanged = true;
     
-    bool needsDescendentsClippingLayer = compositor().clipsCompositingDescendants(m_owningLayer);
+    bool needsDescendentsClippingLayer = compositor().clipsCompositingDescendants(*m_owningLayer);
 
     // Our scrolling layer will clip.
     if (m_owningLayer->needsCompositedScrolling())
         needsDescendentsClippingLayer = false;
 
-    if (updateAncestorClippingLayer(compositor().clippedByAncestor(m_owningLayer)))
+    if (updateAncestorClippingLayer(compositor().clippedByAncestor(*m_owningLayer)))
         layerConfigChanged = true;
 
     if (updateDescendantClippingLayer(needsDescendentsClippingLayer))
@@ -816,7 +816,7 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
 
         IntSize scrollingContentsOffset = toIntSize(paddingBox.location() - scrollOffset);
         if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRenderer() || scrollSize != m_scrollingContentsLayer->size())
-            compositor().scrollingLayerDidChange(m_owningLayer);
+            compositor().scrollingLayerDidChange(*m_owningLayer);
 
         m_scrollingContentsLayer->setSize(scrollSize);
         // FIXME: The paint offset and the scroll offset should really be separate concepts.
@@ -829,7 +829,7 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
     }
 
     // If this layer was created just for clipping or to apply perspective, it doesn't need its own backing store.
-    setRequiresOwnBackingStore(compositor().requiresOwnBackingStore(m_owningLayer, compAncestor, relativeCompositingBounds, ancestorCompositingBounds));
+    setRequiresOwnBackingStore(compositor().requiresOwnBackingStore(*m_owningLayer, compAncestor, relativeCompositingBounds, ancestorCompositingBounds));
 
     bool didUpdateContentsRect = false;
     updateDirectlyCompositedContents(isSimpleContainer, didUpdateContentsRect);
@@ -859,7 +859,7 @@ void RenderLayerBacking::registerScrollingLayers()
     if (!scrollingCoordinator)
         return;
 
-    compositor().updateViewportConstraintStatus(m_owningLayer);
+    compositor().updateViewportConstraintStatus(*m_owningLayer);
 
     if (!scrollingCoordinator->supportsFixedPositionLayers())
         return;
@@ -1281,7 +1281,7 @@ bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers)
         updateInternalHierarchy();
         m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer());
         m_graphicsLayer->setNeedsDisplay();
-        compositor().scrollingLayerDidChange(m_owningLayer);
+        compositor().scrollingLayerDidChange(*m_owningLayer);
     }
 
     return layerChanged;
@@ -1892,7 +1892,7 @@ void RenderLayerBacking::setRequiresOwnBackingStore(bool requiresOwnBacking)
     m_owningLayer->clearClipRectsIncludingDescendants(PaintingClipRects);
     m_owningLayer->computeRepaintRectsIncludingDescendants();
     
-    compositor().repaintInCompositedAncestor(m_owningLayer, compositedBounds());
+    compositor().repaintInCompositedAncestor(*m_owningLayer, compositedBounds());
 }
 
 #if ENABLE(CSS_COMPOSITING)
@@ -2068,7 +2068,7 @@ float RenderLayerBacking::deviceScaleFactor() const
 
 void RenderLayerBacking::didCommitChangesForLayer(const GraphicsLayer* layer) const
 {
-    compositor().didFlushChangesForLayer(m_owningLayer, layer);
+    compositor().didFlushChangesForLayer(*m_owningLayer, layer);
 }
 
 bool RenderLayerBacking::getCurrentTransform(const GraphicsLayer* graphicsLayer, TransformationMatrix& transform) const
index f08a54b94e01fde43571401da6417ee6dfb6724c..739f2a1a4c7488c7707e90cf93d6bf224149b28b 100644 (file)
@@ -391,22 +391,19 @@ void RenderLayerCompositor::flushPendingLayerChanges(bool isFlushRoot)
     ASSERT(m_flushingLayers);
     m_flushingLayers = false;
 
-    if (!m_viewportConstrainedLayersNeedingUpdate.isEmpty()) {
-        HashSet<RenderLayer*>::const_iterator end = m_viewportConstrainedLayersNeedingUpdate.end();
-        for (HashSet<RenderLayer*>::const_iterator it = m_viewportConstrainedLayersNeedingUpdate.begin(); it != end; ++it)
-            registerOrUpdateViewportConstrainedLayer(*it);
-        
-        m_viewportConstrainedLayersNeedingUpdate.clear();
-    }
+    for (auto it = m_viewportConstrainedLayersNeedingUpdate.begin(), end = m_viewportConstrainedLayersNeedingUpdate.end(); it != end; ++it)
+        registerOrUpdateViewportConstrainedLayer(**it);
+    m_viewportConstrainedLayersNeedingUpdate.clear();
+
     startLayerFlushTimerIfNeeded();
 }
 
-void RenderLayerCompositor::didFlushChangesForLayer(RenderLayer* layer, const GraphicsLayer* graphicsLayer)
+void RenderLayerCompositor::didFlushChangesForLayer(RenderLayer& layer, const GraphicsLayer* graphicsLayer)
 {
-    if (m_viewportConstrainedLayers.contains(layer))
-        m_viewportConstrainedLayersNeedingUpdate.add(layer);
+    if (m_viewportConstrainedLayers.contains(&layer))
+        m_viewportConstrainedLayersNeedingUpdate.add(&layer);
 
-    RenderLayerBacking* backing = layer->backing();
+    RenderLayerBacking* backing = layer.backing();
     if (backing->backgroundLayerPaintsFixedRootBackground() && graphicsLayer == backing->backgroundLayer())
         fixedRootBackgroundLayerChanged();
 }
@@ -482,9 +479,9 @@ void RenderLayerCompositor::updateCompositingLayersTimerFired(Timer<RenderLayerC
     updateCompositingLayers(CompositingUpdateAfterLayout);
 }
 
-bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const
+bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer& rootLayer) const
 {
-    return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0);
+    return m_compositedLayerCount > (rootLayer.isComposited() ? 1 : 0);
 }
 
 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
@@ -536,7 +533,7 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
 
     // Only clear the flag if we're updating the entire hierarchy.
     m_compositingLayersNeedRebuild = false;
-    updateRoot = rootRenderLayer();
+    updateRoot = &rootRenderLayer();
 
     if (isFullUpdate && updateType == CompositingUpdateAfterLayout)
         m_reevaluateCompositingAfterLayout = false;
@@ -558,7 +555,7 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
         bool layersChanged = false;
         bool saw3DTransform = false;
         OverlapMap overlapTestRequestMap;
-        computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap, compState, layersChanged, saw3DTransform);
+        computeCompositingRequirements(nullptr, *updateRoot, &overlapTestRequestMap, compState, layersChanged, saw3DTransform);
         needHierarchyUpdate |= layersChanged;
     }
 
@@ -578,13 +575,13 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
     if (needHierarchyUpdate) {
         // Update the hierarchy of the compositing layers.
         Vector<GraphicsLayer*> childList;
-        rebuildCompositingLayerTree(updateRoot, childList, 0);
+        rebuildCompositingLayerTree(*updateRoot, childList, 0);
 
         // Host the document layer in the RenderView's root layer.
         if (isFullUpdate) {
             // Even when childList is empty, don't drop out of compositing mode if there are
             // composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
-            if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateRoot))
+            if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(*updateRoot))
                 destroyRootLayer();
             else
                 m_rootContentLayer->setChildren(childList);
@@ -592,7 +589,7 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
     } else if (needGeometryUpdate) {
         // We just need to do a geometry update. This is only used for position:fixed scrolling;
         // most of the time, geometry is updated via RenderLayer::styleChanged().
-        updateLayerTreeGeometry(updateRoot, 0);
+        updateLayerTreeGeometry(*updateRoot, 0);
     }
     
 #if !LOG_DISABLED
@@ -620,23 +617,23 @@ void RenderLayerCompositor::updateRenderFlowThreadLayersIfNeeded()
         m_renderView.flowThreadController().updateRenderFlowThreadLayersIfNeeded();
 }
 
-void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer* renderLayer)
+void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer& layer)
 {
     // Inform the inspector that the given RenderLayer was destroyed.
-    InspectorInstrumentation::renderLayerDestroyed(page(), renderLayer);
+    InspectorInstrumentation::renderLayerDestroyed(page(), &layer);
 
     ASSERT(m_compositedLayerCount > 0);
     --m_compositedLayerCount;
 }
 
 #if !LOG_DISABLED
-void RenderLayerCompositor::logLayerInfo(const RenderLayer* layer, int depth)
+void RenderLayerCompositor::logLayerInfo(const RenderLayer& layer, int depth)
 {
     if (!compositingLogEnabled())
         return;
 
-    RenderLayerBacking* backing = layer->backing();
-    if (requiresCompositingLayer(layer) || layer->isRootLayer()) {
+    RenderLayerBacking* backing = layer.backing();
+    if (requiresCompositingLayer(layer) || layer.isRootLayer()) {
         ++m_obligateCompositedLayerCount;
         m_obligatoryBackingStoreBytes += backing->backingStoreMemoryEstimate();
     } else {
@@ -645,7 +642,7 @@ void RenderLayerCompositor::logLayerInfo(const RenderLayer* layer, int depth)
     }
 
     StringBuilder logString;
-    logString.append(String::format("%*p %dx%d %.2fKB", 12 + depth * 2, layer,
+    logString.append(String::format("%*p %dx%d %.2fKB", 12 + depth * 2, &layer,
         backing->compositedBounds().width().round(), backing->compositedBounds().height().round(),
         backing->backingStoreMemoryEstimate() / 1024));
     
@@ -662,13 +659,13 @@ void RenderLayerCompositor::logLayerInfo(const RenderLayer* layer, int depth)
         logString.append("] ");
     }
 
-    logString.append(layer->name());
+    logString.append(layer.name());
 
     LOG(Compositing, "%s", logString.toString().utf8().data());
 }
 #endif
 
-bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeRepaint shouldRepaint)
+bool RenderLayerCompositor::updateBacking(RenderLayer& layer, CompositingChangeRepaint shouldRepaint)
 {
     bool layerChanged = false;
     RenderLayer::ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReason = RenderLayer::NoNotCompositedReason;
@@ -676,16 +673,16 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR
     if (needsToBeComposited(layer, &viewportConstrainedNotCompositedReason)) {
         enableCompositingMode();
         
-        if (!layer->backing()) {
+        if (!layer.backing()) {
             // If we need to repaint, do so before making backing
             if (shouldRepaint == CompositingChangeRepaintNow)
                 repaintOnCompositingChange(layer);
 
-            layer->ensureBacking();
+            layer.ensureBacking();
 
             // At this time, the ScrollingCooridnator only supports the top-level frame.
-            if (layer->isRootLayer() && !m_renderView.document().ownerElement()) {
-                layer->backing()->attachToScrollingCoordinatorWithParent(0);
+            if (layer.isRootLayer() && !m_renderView.document().ownerElement()) {
+                layer.backing()->attachToScrollingCoordinatorWithParent(0);
                 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
                     scrollingCoordinator->frameViewRootLayerDidChange(&m_renderView.frameView());
 #if ENABLE(RUBBER_BANDING)
@@ -698,32 +695,32 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR
 
             // This layer and all of its descendants have cached repaints rects that are relative to
             // the repaint container, so change when compositing changes; we need to update them here.
-            if (layer->parent())
-                layer->computeRepaintRectsIncludingDescendants();
+            if (layer.parent())
+                layer.computeRepaintRectsIncludingDescendants();
 
             layerChanged = true;
         }
     } else {
-        if (layer->backing()) {
+        if (layer.backing()) {
             // If we're removing backing on a reflection, clear the source GraphicsLayer's pointer to
             // its replica GraphicsLayer. In practice this should never happen because reflectee and reflection 
             // are both either composited, or not composited.
-            if (layer->isReflection()) {
-                RenderLayer* sourceLayer = toRenderLayerModelObject(layer->renderer().parent())->layer();
+            if (layer.isReflection()) {
+                RenderLayer* sourceLayer = toRenderLayerModelObject(layer.renderer().parent())->layer();
                 if (RenderLayerBacking* backing = sourceLayer->backing()) {
-                    ASSERT(backing->graphicsLayer()->replicaLayer() == layer->backing()->graphicsLayer());
+                    ASSERT(backing->graphicsLayer()->replicaLayer() == layer.backing()->graphicsLayer());
                     backing->graphicsLayer()->setReplicatedByLayer(0);
                 }
             }
 
             removeViewportConstrainedLayer(layer);
             
-            layer->clearBacking();
+            layer.clearBacking();
             layerChanged = true;
 
             // This layer and all of its descendants have cached repaints rects that are relative to
             // the repaint container, so change when compositing changes; we need to update them here.
-            layer->computeRepaintRectsIncludingDescendants();
+            layer.computeRepaintRectsIncludingDescendants();
 
             // If we need to repaint, do so now that we've removed the backing
             if (shouldRepaint == CompositingChangeRepaintNow)
@@ -732,26 +729,26 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR
     }
     
 #if ENABLE(VIDEO)
-    if (layerChanged && layer->renderer().isVideo()) {
+    if (layerChanged && layer.renderer().isVideo()) {
         // If it's a video, give the media player a chance to hook up to the layer.
-        toRenderVideo(layer->renderer()).acceleratedRenderingStateChanged();
+        toRenderVideo(layer.renderer()).acceleratedRenderingStateChanged();
     }
 #endif
 
-    if (layerChanged && layer->renderer().isWidget()) {
-        RenderLayerCompositor* innerCompositor = frameContentsCompositor(toRenderWidget(&layer->renderer()));
+    if (layerChanged && layer.renderer().isWidget()) {
+        RenderLayerCompositor* innerCompositor = frameContentsCompositor(toRenderWidget(&layer.renderer()));
         if (innerCompositor && innerCompositor->inCompositingMode())
             innerCompositor->updateRootLayerAttachment();
     }
     
     if (layerChanged)
-        layer->clearClipRectsIncludingDescendants(PaintingClipRects);
+        layer.clearClipRectsIncludingDescendants(PaintingClipRects);
 
     // If a fixed position layer gained/lost a backing or the reason not compositing it changed,
     // the scrolling coordinator needs to recalculate whether it can do fast scrolling.
-    if (layer->renderer().style()->position() == FixedPosition) {
-        if (layer->viewportConstrainedNotCompositedReason() != viewportConstrainedNotCompositedReason) {
-            layer->setViewportConstrainedNotCompositedReason(viewportConstrainedNotCompositedReason);
+    if (layer.renderer().style()->position() == FixedPosition) {
+        if (layer.viewportConstrainedNotCompositedReason() != viewportConstrainedNotCompositedReason) {
+            layer.setViewportConstrainedNotCompositedReason(viewportConstrainedNotCompositedReason);
             layerChanged = true;
         }
         if (layerChanged) {
@@ -759,37 +756,37 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR
                 scrollingCoordinator->frameViewFixedObjectsDidChange(&m_renderView.frameView());
         }
     } else
-        layer->setViewportConstrainedNotCompositedReason(RenderLayer::NoNotCompositedReason);
+        layer.setViewportConstrainedNotCompositedReason(RenderLayer::NoNotCompositedReason);
     
-    if (layer->backing())
-        layer->backing()->updateDebugIndicators(m_showDebugBorders, m_showRepaintCounter);
+    if (layer.backing())
+        layer.backing()->updateDebugIndicators(m_showDebugBorders, m_showRepaintCounter);
 
     return layerChanged;
 }
 
-bool RenderLayerCompositor::updateLayerCompositingState(RenderLayer* layer, CompositingChangeRepaint shouldRepaint)
+bool RenderLayerCompositor::updateLayerCompositingState(RenderLayer& layer, CompositingChangeRepaint shouldRepaint)
 {
     bool layerChanged = updateBacking(layer, shouldRepaint);
 
     // See if we need content or clipping layers. Methods called here should assume
     // that the compositing state of descendant layers has not been updated yet.
-    if (layer->backing() && layer->backing()->updateGraphicsLayerConfiguration())
+    if (layer.backing() && layer.backing()->updateGraphicsLayerConfiguration())
         layerChanged = true;
 
     return layerChanged;
 }
 
-void RenderLayerCompositor::repaintOnCompositingChange(RenderLayer* layer)
+void RenderLayerCompositor::repaintOnCompositingChange(RenderLayer& layer)
 {
     // If the renderer is not attached yet, no need to repaint.
-    if (&layer->renderer() != &m_renderView && !layer->renderer().parent())
+    if (&layer.renderer() != &m_renderView && !layer.renderer().parent())
         return;
 
-    RenderLayerModelObject* repaintContainer = layer->renderer().containerForRepaint();
+    RenderLayerModelObject* repaintContainer = layer.renderer().containerForRepaint();
     if (!repaintContainer)
         repaintContainer = &m_renderView;
 
-    layer->repaintIncludingNonCompositingDescendants(repaintContainer);
+    layer.repaintIncludingNonCompositingDescendants(repaintContainer);
     if (repaintContainer == &m_renderView) {
         // The contents of this layer may be moving between the window
         // and a GraphicsLayer, so we need to make sure the window system
@@ -799,14 +796,14 @@ void RenderLayerCompositor::repaintOnCompositingChange(RenderLayer* layer)
 }
 
 // This method assumes that layout is up-to-date, unlike repaintOnCompositingChange().
-void RenderLayerCompositor::repaintInCompositedAncestor(RenderLayer* layer, const LayoutRect& rect)
+void RenderLayerCompositor::repaintInCompositedAncestor(RenderLayer& layer, const LayoutRect& rect)
 {
-    RenderLayer* compositedAncestor = layer->enclosingCompositingLayerForRepaint(ExcludeSelf);
+    RenderLayer* compositedAncestor = layer.enclosingCompositingLayerForRepaint(ExcludeSelf);
     if (compositedAncestor) {
         ASSERT(compositedAncestor->backing());
 
         LayoutPoint offset;
-        layer->convertToLayerCoords(compositedAncestor, offset);
+        layer.convertToLayerCoords(compositedAncestor, offset);
 
         LayoutRect repaintRect = rect;
         repaintRect.moveBy(offset);
@@ -822,107 +819,97 @@ void RenderLayerCompositor::repaintInCompositedAncestor(RenderLayer* layer, cons
 
 // The bounds of the GraphicsLayer created for a compositing layer is the union of the bounds of all the descendant
 // RenderLayers that are rendered by the composited RenderLayer.
-LayoutRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer) const
+LayoutRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer& layer, const RenderLayer& ancestorLayer) const
 {
     if (!canBeComposited(layer))
         return LayoutRect();
-    return layer->calculateLayerBounds(ancestorLayer, 0, RenderLayer::DefaultCalculateLayerBoundsFlags | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
+    return layer.calculateLayerBounds(&ancestorLayer, nullptr, RenderLayer::DefaultCalculateLayerBoundsFlags | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask);
 }
 
-void RenderLayerCompositor::layerWasAdded(RenderLayer* /*parent*/, RenderLayer* /*child*/)
+void RenderLayerCompositor::layerWasAdded(RenderLayer&, RenderLayer&)
 {
     setCompositingLayersNeedRebuild();
 }
 
-void RenderLayerCompositor::layerWillBeRemoved(RenderLayer* parent, RenderLayer* child)
+void RenderLayerCompositor::layerWillBeRemoved(RenderLayer& parent, RenderLayer& child)
 {
-    if (!child->isComposited() || parent->renderer().documentBeingDestroyed())
+    if (!child.isComposited() || parent.renderer().documentBeingDestroyed())
         return;
 
     removeViewportConstrainedLayer(child);
-    repaintInCompositedAncestor(child, child->backing()->compositedBounds());
+    repaintInCompositedAncestor(child, child.backing()->compositedBounds());
 
-    setCompositingParent(child, 0);
+    setCompositingParent(child, nullptr);
     setCompositingLayersNeedRebuild();
 }
 
-RenderLayer* RenderLayerCompositor::enclosingNonStackingClippingLayer(const RenderLayer* layer) const
+RenderLayer* RenderLayerCompositor::enclosingNonStackingClippingLayer(const RenderLayer& layer) const
 {
-    for (RenderLayer* curr = layer->parent(); curr != 0; curr = curr->parent()) {
-        if (curr->isStackingContainer())
-            return 0;
-
-        if (curr->renderer().hasClipOrOverflowClip())
-            return curr;
+    for (RenderLayer* parent = layer.parent(); parent; parent = parent->parent()) {
+        if (parent->isStackingContainer())
+            return nullptr;
+        if (parent->renderer().hasClipOrOverflowClip())
+            return parent;
     }
-    return 0;
+    return nullptr;
 }
 
-void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer* layer, IntRect& layerBounds, bool& boundsComputed)
+void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer& layer, IntRect& layerBounds, bool& boundsComputed)
 {
-    if (layer->isRootLayer())
+    if (layer.isRootLayer())
         return;
 
     if (!boundsComputed) {
         // FIXME: If this layer's overlap bounds include its children, we don't need to add its
         // children's bounds to the overlap map.
-        layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(layer->overlapBounds()));
+        layerBounds = enclosingIntRect(overlapMap.geometryMap().absoluteRect(layer.overlapBounds()));
         // Empty rects never intersect, but we need them to for the purposes of overlap testing.
         if (layerBounds.isEmpty())
             layerBounds.setSize(IntSize(1, 1));
         boundsComputed = true;
     }
 
-    IntRect clipRect = pixelSnappedIntRect(layer->backgroundClipRect(RenderLayer::ClipRectsContext(rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.
+    IntRect clipRect = pixelSnappedIntRect(layer.backgroundClipRect(RenderLayer::ClipRectsContext(&rootRenderLayer(), 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.
     const Settings& settings = m_renderView.frameView().frame().settings();
     if (!settings.applyPageScaleFactorInCompositor())
         clipRect.scale(pageScaleFactor());
     clipRect.intersect(layerBounds);
-    overlapMap.add(layer, clipRect);
+    overlapMap.add(&layer, clipRect);
 }
 
-void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, RenderLayer* layer, RenderLayer* ancestorLayer)
+void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, RenderLayer& layer, RenderLayer* ancestorLayer)
 {
-    if (!canBeComposited(layer) || overlapMap.contains(layer))
+    if (!canBeComposited(layer) || overlapMap.contains(&layer))
         return;
 
     // A null ancestorLayer is an indication that 'layer' has already been pushed.
     if (ancestorLayer)
-        overlapMap.geometryMap().pushMappingsToAncestor(layer, ancestorLayer);
+        overlapMap.geometryMap().pushMappingsToAncestor(&layer, ancestorLayer);
     
     IntRect bounds;
     bool haveComputedBounds = false;
     addToOverlapMap(overlapMap, layer, bounds, haveComputedBounds);
 
 #if !ASSERT_DISABLED
-    LayerListMutationDetector mutationChecker(layer);
+    LayerListMutationDetector mutationChecker(&layer);
 #endif
 
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
-            size_t listSize = negZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = negZOrderList->at(i);
-                addToOverlapMapRecursive(overlapMap, curLayer, layer);
-            }
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* negZOrderList = layer.negZOrderList()) {
+            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i)
+                addToOverlapMapRecursive(overlapMap, *negZOrderList->at(i), &layer);
         }
     }
 
-    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
-        size_t listSize = normalFlowList->size();
-        for (size_t i = 0; i < listSize; ++i) {
-            RenderLayer* curLayer = normalFlowList->at(i);
-            addToOverlapMapRecursive(overlapMap, curLayer, layer);
-        }
+    if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) {
+        for (size_t i = 0, size = normalFlowList->size(); i < size; ++i)
+            addToOverlapMapRecursive(overlapMap, *normalFlowList->at(i), &layer);
     }
 
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
-            size_t listSize = posZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = posZOrderList->at(i);
-                addToOverlapMapRecursive(overlapMap, curLayer, layer);
-            }
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* posZOrderList = layer.posZOrderList()) {
+            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i)
+                addToOverlapMapRecursive(overlapMap, *posZOrderList->at(i), &layer);
         }
     }
     
@@ -939,19 +926,19 @@ void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, Ren
 //      must be compositing so that its contents render over that child.
 //      This implies that its positive z-index children must also be compositing.
 //
-void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer* layer, OverlapMap* overlapMap, CompositingState& compositingState, bool& layersChanged, bool& descendantHas3DTransform)
+void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer& layer, OverlapMap* overlapMap, CompositingState& compositingState, bool& layersChanged, bool& descendantHas3DTransform)
 {
-    layer->updateDescendantDependentFlags();
-    layer->updateLayerListsIfNeeded();
+    layer.updateDescendantDependentFlags();
+    layer.updateLayerListsIfNeeded();
 
-    if (layer->isOutOfFlowRenderFlowThread())
+    if (layer.isOutOfFlowRenderFlowThread())
         return;
 
     if (overlapMap)
-        overlapMap->geometryMap().pushMappingsToAncestor(layer, ancestorLayer);
+        overlapMap->geometryMap().pushMappingsToAncestor(&layer, ancestorLayer);
     
     // Clear the flag
-    layer->setHasCompositingDescendant(false);
+    layer.setHasCompositingDescendant(false);
 
     RenderLayer::IndirectCompositingReason compositingReason = compositingState.m_subtreeIsCompositing ? RenderLayer::IndirectCompositingForStacking : RenderLayer::NoIndirectCompositingReason;
 
@@ -959,7 +946,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
     IntRect absBounds;
     if (overlapMap && !overlapMap->isEmpty() && compositingState.m_testingOverlap) {
         // If we're testing for overlap, we only need to composite if we overlap something that is already composited.
-        absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(layer->overlapBounds()));
+        absBounds = enclosingIntRect(overlapMap->geometryMap().absoluteRect(layer.overlapBounds()));
 
         // Empty rects never intersect, but we need them to for the purposes of overlap testing.
         if (absBounds.isEmpty())
@@ -977,7 +964,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
         compositingReason = RenderLayer::IndirectCompositingForOverlap;
 #endif
 
-    layer->setIndirectCompositingReason(compositingReason);
+    layer.setIndirectCompositingReason(compositingReason);
 
     // The children of this layer don't need to composite, unless there is
     // a compositing layer among them, so start by inheriting the compositing
@@ -990,7 +977,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
         // Tell the parent it has compositing descendants.
         compositingState.m_subtreeIsCompositing = true;
         // This layer now acts as the ancestor for kids.
-        childState.m_compositingAncestor = layer;
+        childState.m_compositingAncestor = &layer;
 
         if (overlapMap)
             overlapMap->pushCompositingContainer();
@@ -1000,24 +987,22 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
     }
 
 #if !ASSERT_DISABLED
-    LayerListMutationDetector mutationChecker(layer);
+    LayerListMutationDetector mutationChecker(&layer);
 #endif
 
     bool anyDescendantHas3DTransform = false;
 
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
-            size_t listSize = negZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = negZOrderList->at(i);
-                computeCompositingRequirements(layer, curLayer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* negZOrderList = layer.negZOrderList()) {
+            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i) {
+                computeCompositingRequirements(&layer, *negZOrderList->at(i), overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
 
                 // If we have to make a layer for this child, make one now so we can have a contents layer
                 // (since we need to ensure that the -ve z-order child renders underneath our contents).
                 if (!willBeComposited && childState.m_subtreeIsCompositing) {
                     // make layer compositing
-                    layer->setIndirectCompositingReason(RenderLayer::IndirectCompositingForBackgroundLayer);
-                    childState.m_compositingAncestor = layer;
+                    layer.setIndirectCompositingReason(RenderLayer::IndirectCompositingForBackgroundLayer);
+                    childState.m_compositingAncestor = &layer;
                     if (overlapMap)
                         overlapMap->pushCompositingContainer();
                     // This layer is going to be composited, so children can safely ignore the fact that there's an 
@@ -1029,26 +1014,20 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
         }
     }
     
-    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
-        size_t listSize = normalFlowList->size();
-        for (size_t i = 0; i < listSize; ++i) {
-            RenderLayer* curLayer = normalFlowList->at(i);
-            computeCompositingRequirements(layer, curLayer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
-        }
+    if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) {
+        for (size_t i = 0, size = normalFlowList->size(); i < size; ++i)
+            computeCompositingRequirements(&layer, *normalFlowList->at(i), overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
     }
 
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
-            size_t listSize = posZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = posZOrderList->at(i);
-                computeCompositingRequirements(layer, curLayer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
-            }
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* posZOrderList = layer.posZOrderList()) {
+            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i)
+                computeCompositingRequirements(&layer, *posZOrderList->at(i), overlapMap, childState, layersChanged, anyDescendantHas3DTransform);
         }
     }
     
     // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled).
-    if (layer->isRootLayer()) {
+    if (layer.isRootLayer()) {
         if (inCompositingMode() && m_hasAcceleratedCompositing)
             willBeComposited = true;
     }
@@ -1064,9 +1043,9 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
     // Now check for reasons to become composited that depend on the state of descendant layers.
     RenderLayer::IndirectCompositingReason indirectCompositingReason;
     if (!willBeComposited && canBeComposited(layer)
-        && requiresCompositingForIndirectReason(&layer->renderer(), childState.m_subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {
-        layer->setIndirectCompositingReason(indirectCompositingReason);
-        childState.m_compositingAncestor = layer;
+        && requiresCompositingForIndirectReason(layer.renderer(), childState.m_subtreeIsCompositing, anyDescendantHas3DTransform, indirectCompositingReason)) {
+        layer.setIndirectCompositingReason(indirectCompositingReason);
+        childState.m_compositingAncestor = &layer;
         if (overlapMap) {
             overlapMap->pushCompositingContainer();
             addToOverlapMapRecursive(*overlapMap, layer);
@@ -1075,9 +1054,9 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
     }
     
     ASSERT(willBeComposited == needsToBeComposited(layer));
-    if (layer->reflectionLayer()) {
+    if (layer.reflectionLayer()) {
         // FIXME: Shouldn't we call computeCompositingRequirements to handle a reflection overlapping with another renderer?
-        layer->reflectionLayer()->setIndirectCompositingReason(willBeComposited ? RenderLayer::IndirectCompositingForStacking : RenderLayer::NoIndirectCompositingReason);
+        layer.reflectionLayer()->setIndirectCompositingReason(willBeComposited ? RenderLayer::IndirectCompositingForStacking : RenderLayer::NoIndirectCompositingReason);
     }
 
     // Subsequent layers in the parent stacking context also need to composite.
@@ -1085,7 +1064,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
         compositingState.m_subtreeIsCompositing = true;
 
     // Set the flag to say that this SC has compositing children.
-    layer->setHasCompositingDescendant(childState.m_subtreeIsCompositing);
+    layer.setHasCompositingDescendant(childState.m_subtreeIsCompositing);
 
     // setHasCompositingDescendant() may have changed the answer to needsToBeComposited() when clipping,
     // so test that again.
@@ -1094,12 +1073,12 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
     // Turn overlap testing off for later layers if it's already off, or if we have an animating transform.
     // Note that if the layer clips its descendants, there's no reason to propagate the child animation to the parent layers. That's because
     // we know for sure the animation is contained inside the clipping rectangle, which is already added to the overlap map.
-    if ((!childState.m_testingOverlap && !isCompositedClippingLayer) || isRunningAcceleratedTransformAnimation(&layer->renderer()))
+    if ((!childState.m_testingOverlap && !isCompositedClippingLayer) || isRunningAcceleratedTransformAnimation(layer.renderer()))
         compositingState.m_testingOverlap = false;
     
     if (isCompositedClippingLayer) {
         if (!willBeComposited) {
-            childState.m_compositingAncestor = layer;
+            childState.m_compositingAncestor = &layer;
             if (overlapMap) {
                 overlapMap->pushCompositingContainer();
                 addToOverlapMapRecursive(*overlapMap, layer);
@@ -1108,39 +1087,39 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
          }
     }
 
-    if (overlapMap && childState.m_compositingAncestor == layer && !layer->isRootLayer())
+    if (overlapMap && childState.m_compositingAncestor == &layer && !layer.isRootLayer())
         overlapMap->popCompositingContainer();
 
     // If we're back at the root, and no other layers need to be composited, and the root layer itself doesn't need
     // to be composited, then we can drop out of compositing mode altogether. However, don't drop out of compositing mode
     // if there are composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
-    if (layer->isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) {
+    if (layer.isRootLayer() && !childState.m_subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) {
         enableCompositingMode(false);
         willBeComposited = false;
     }
     
     // If the layer is going into compositing mode, repaint its old location.
     ASSERT(willBeComposited == needsToBeComposited(layer));
-    if (!layer->isComposited() && willBeComposited)
+    if (!layer.isComposited() && willBeComposited)
         repaintOnCompositingChange(layer);
 
     // Update backing now, so that we can use isComposited() reliably during tree traversal in rebuildCompositingLayerTree().
     if (updateBacking(layer, CompositingChangeRepaintNow))
         layersChanged = true;
 
-    if (layer->reflectionLayer() && updateLayerCompositingState(layer->reflectionLayer(), CompositingChangeRepaintNow))
+    if (layer.reflectionLayer() && updateLayerCompositingState(*layer.reflectionLayer(), CompositingChangeRepaintNow))
         layersChanged = true;
 
-    descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DTransform();
+    descendantHas3DTransform |= anyDescendantHas3DTransform || layer.has3DTransform();
 
     if (overlapMap)
         overlapMap->geometryMap().popMappingsToAncestor(ancestorLayer);
 }
 
-void RenderLayerCompositor::setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
+void RenderLayerCompositor::setCompositingParent(RenderLayer& childLayer, RenderLayer* parentLayer)
 {
-    ASSERT(!parentLayer || childLayer->ancestorCompositingLayer() == parentLayer);
-    ASSERT(childLayer->isComposited());
+    ASSERT(!parentLayer || childLayer.ancestorCompositingLayer() == parentLayer);
+    ASSERT(childLayer.isComposited());
 
     // It's possible to be called with a parent that isn't yet composited when we're doing
     // partial updates as required by painting or hit testing. Just bail in that case;
@@ -1150,19 +1129,18 @@ void RenderLayerCompositor::setCompositingParent(RenderLayer* childLayer, Render
 
     if (parentLayer) {
         GraphicsLayer* hostingLayer = parentLayer->backing()->parentForSublayers();
-        GraphicsLayer* hostedLayer = childLayer->backing()->childForSuperlayers();
+        GraphicsLayer* hostedLayer = childLayer.backing()->childForSuperlayers();
         
         hostingLayer->addChild(hostedLayer);
     } else
-        childLayer->backing()->childForSuperlayers()->removeFromParent();
+        childLayer.backing()->childForSuperlayers()->removeFromParent();
 }
 
-void RenderLayerCompositor::removeCompositedChildren(RenderLayer* layer)
+void RenderLayerCompositor::removeCompositedChildren(RenderLayer& layer)
 {
-    ASSERT(layer->isComposited());
+    ASSERT(layer.isComposited());
 
-    GraphicsLayer* hostingLayer = layer->backing()->parentForSublayers();
-    hostingLayer->removeAllChildren();
+    layer.backing()->parentForSublayers()->removeAllChildren();
 }
 
 #if ENABLE(VIDEO)
@@ -1175,22 +1153,22 @@ bool RenderLayerCompositor::canAccelerateVideoRendering(RenderVideo& video) cons
 }
 #endif
 
-void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, Vector<GraphicsLayer*>& childLayersOfEnclosingLayer, int depth)
+void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer& layer, Vector<GraphicsLayer*>& childLayersOfEnclosingLayer, int depth)
 {
     // Make the layer compositing if necessary, and set up clipping and content layers.
     // Note that we can only do work here that is independent of whether the descendant layers
     // have been processed. computeCompositingRequirements() will already have done the repaint if necessary.
 
-    if (layer->isOutOfFlowRenderFlowThread())
+    if (layer.isOutOfFlowRenderFlowThread())
         return;
     
-    RenderLayerBacking* layerBacking = layer->backing();
+    RenderLayerBacking* layerBacking = layer.backing();
     if (layerBacking) {
         // The compositing state of all our children has been updated already, so now
         // we can compute and cache the composited bounds for this layer.
         layerBacking->updateCompositedBounds();
 
-        if (RenderLayer* reflection = layer->reflectionLayer()) {
+        if (RenderLayer* reflection = layer.reflectionLayer()) {
             if (reflection->backing())
                 reflection->backing()->updateCompositedBounds();
         }
@@ -1200,7 +1178,7 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, Vect
         
         layerBacking->updateGraphicsLayerGeometry();
 
-        if (!layer->parent())
+        if (!layer.parent())
             updateRootLayerPosition();
 
 #if !LOG_DISABLED
@@ -1209,7 +1187,7 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, Vect
         UNUSED_PARAM(depth);
 #endif
         if (layerBacking->hasUnpositionedOverflowControlsLayers())
-            layer->positionNewlyCreatedOverflowControls();
+            layer.positionNewlyCreatedOverflowControls();
     }
 
     // If this layer has backing, then we are collecting its children, otherwise appending
@@ -1218,16 +1196,13 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, Vect
     Vector<GraphicsLayer*>& childList = layerBacking ? layerChildren : childLayersOfEnclosingLayer;
 
 #if !ASSERT_DISABLED
-    LayerListMutationDetector mutationChecker(layer);
+    LayerListMutationDetector mutationChecker(&layer);
 #endif
 
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
-            size_t listSize = negZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = negZOrderList->at(i);
-                rebuildCompositingLayerTree(curLayer, childList, depth + 1);
-            }
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* negZOrderList = layer.negZOrderList()) {
+            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i)
+                rebuildCompositingLayerTree(*negZOrderList->at(i), childList, depth + 1);
         }
 
         // If a negative z-order child is compositing, we get a foreground layer which needs to get parented.
@@ -1235,28 +1210,22 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, Vect
             childList.append(layerBacking->foregroundLayer());
     }
 
-    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
-        size_t listSize = normalFlowList->size();
-        for (size_t i = 0; i < listSize; ++i) {
-            RenderLayer* curLayer = normalFlowList->at(i);
-            rebuildCompositingLayerTree(curLayer, childList, depth + 1);
-        }
+    if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) {
+        for (size_t i = 0, size = normalFlowList->size(); i < size; ++i)
+            rebuildCompositingLayerTree(*normalFlowList->at(i), childList, depth + 1);
     }
     
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
-            size_t listSize = posZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = posZOrderList->at(i);
-                rebuildCompositingLayerTree(curLayer, childList, depth + 1);
-            }
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* posZOrderList = layer.posZOrderList()) {
+            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i)
+                rebuildCompositingLayerTree(*posZOrderList->at(i), childList, depth + 1);
         }
     }
     
     if (layerBacking) {
         bool parented = false;
-        if (layer->renderer().isWidget())
-            parented = parentFrameContentLayers(toRenderWidget(&layer->renderer()));
+        if (layer.renderer().isWidget())
+            parented = parentFrameContentLayers(toRenderWidget(&layer.renderer()));
 
         if (!parented)
             layerBacking->parentForSublayers()->setChildren(layerChildren);
@@ -1359,10 +1328,10 @@ void RenderLayerCompositor::rootFixedBackgroundsChanged()
         setCompositingLayersNeedRebuild();
 }
 
-void RenderLayerCompositor::scrollingLayerDidChange(RenderLayer* layer)
+void RenderLayerCompositor::scrollingLayerDidChange(RenderLayer& layer)
 {
     if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
-        scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer);
+        scrollingCoordinator->scrollableAreaScrollLayerDidChange(&layer);
 }
 
 void RenderLayerCompositor::fixedRootBackgroundLayerChanged()
@@ -1444,18 +1413,18 @@ bool RenderLayerCompositor::parentFrameContentLayers(RenderWidget* renderer)
 }
 
 // This just updates layer geometry without changing the hierarchy.
-void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer, int depth)
+void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer& layer, int depth)
 {
     // FIXME: fixed positioned elements inside a named flow are not composited yet.
-    if (layer->isOutOfFlowRenderFlowThread())
+    if (layer.isOutOfFlowRenderFlowThread())
         return;
 
-    if (RenderLayerBacking* layerBacking = layer->backing()) {
+    if (RenderLayerBacking* layerBacking = layer.backing()) {
         // The compositing state of all our children has been updated already, so now
         // we can compute and cache the composited bounds for this layer.
         layerBacking->updateCompositedBounds();
 
-        if (RenderLayer* reflection = layer->reflectionLayer()) {
+        if (RenderLayer* reflection = layer.reflectionLayer()) {
             if (reflection->backing())
                 reflection->backing()->updateCompositedBounds();
         }
@@ -1463,7 +1432,7 @@ void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer, int dept
         layerBacking->updateGraphicsLayerConfiguration();
         layerBacking->updateGraphicsLayerGeometry();
 
-        if (!layer->parent())
+        if (!layer.parent())
             updateRootLayerPosition();
 
 #if !LOG_DISABLED
@@ -1474,40 +1443,37 @@ void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer, int dept
     }
 
 #if !ASSERT_DISABLED
-    LayerListMutationDetector mutationChecker(layer);
+    LayerListMutationDetector mutationChecker(&layer);
 #endif
 
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
-            size_t listSize = negZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i)
-                updateLayerTreeGeometry(negZOrderList->at(i), depth + 1);
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* negZOrderList = layer.negZOrderList()) {
+            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i)
+                updateLayerTreeGeometry(*negZOrderList->at(i), depth + 1);
         }
     }
 
-    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
-        size_t listSize = normalFlowList->size();
-        for (size_t i = 0; i < listSize; ++i)
-            updateLayerTreeGeometry(normalFlowList->at(i), depth + 1);
+    if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) {
+        for (size_t i = 0, size = normalFlowList->size(); i < size; ++i)
+            updateLayerTreeGeometry(*normalFlowList->at(i), depth + 1);
     }
     
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
-            size_t listSize = posZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i)
-                updateLayerTreeGeometry(posZOrderList->at(i), depth + 1);
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* posZOrderList = layer.posZOrderList()) {
+            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i)
+                updateLayerTreeGeometry(*posZOrderList->at(i), depth + 1);
         }
     }
 }
 
 // Recurs down the RenderLayer tree until its finds the compositing descendants of compositingAncestor and updates their geometry.
-void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, RenderLayer* layer, bool compositedChildrenOnly)
+void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayer& compositingAncestor, RenderLayer& layer, bool compositedChildrenOnly)
 {
-    if (layer != compositingAncestor) {
-        if (RenderLayerBacking* layerBacking = layer->backing()) {
+    if (&layer != &compositingAncestor) {
+        if (RenderLayerBacking* layerBacking = layer.backing()) {
             layerBacking->updateCompositedBounds();
 
-            if (RenderLayer* reflection = layer->reflectionLayer()) {
+            if (RenderLayer* reflection = layer.reflectionLayer()) {
                 if (reflection->backing())
                     reflection->backing()->updateCompositedBounds();
             }
@@ -1518,35 +1484,35 @@ void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayer* com
         }
     }
 
-    if (layer->reflectionLayer())
-        updateCompositingDescendantGeometry(compositingAncestor, layer->reflectionLayer(), compositedChildrenOnly);
+    if (layer.reflectionLayer())
+        updateCompositingDescendantGeometry(compositingAncestor, *layer.reflectionLayer(), compositedChildrenOnly);
 
-    if (!layer->hasCompositingDescendant())
+    if (!layer.hasCompositingDescendant())
         return;
 
 #if !ASSERT_DISABLED
-    LayerListMutationDetector mutationChecker(layer);
+    LayerListMutationDetector mutationChecker(&layer);
 #endif
     
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* negZOrderList = layer.negZOrderList()) {
             size_t listSize = negZOrderList->size();
             for (size_t i = 0; i < listSize; ++i)
-                updateCompositingDescendantGeometry(compositingAncestor, negZOrderList->at(i), compositedChildrenOnly);
+                updateCompositingDescendantGeometry(compositingAncestor, *negZOrderList->at(i), compositedChildrenOnly);
         }
     }
 
-    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
+    if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) {
         size_t listSize = normalFlowList->size();
         for (size_t i = 0; i < listSize; ++i)
-            updateCompositingDescendantGeometry(compositingAncestor, normalFlowList->at(i), compositedChildrenOnly);
+            updateCompositingDescendantGeometry(compositingAncestor, *normalFlowList->at(i), compositedChildrenOnly);
     }
     
-    if (layer->isStackingContainer()) {
-        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
+    if (layer.isStackingContainer()) {
+        if (Vector<RenderLayer*>* posZOrderList = layer.posZOrderList()) {
             size_t listSize = posZOrderList->size();
             for (size_t i = 0; i < listSize; ++i)
-                updateCompositingDescendantGeometry(compositingAncestor, posZOrderList->at(i), compositedChildrenOnly);
+                updateCompositingDescendantGeometry(compositingAncestor, *posZOrderList->at(i), compositedChildrenOnly);
         }
     }
 }
@@ -1557,64 +1523,61 @@ void RenderLayerCompositor::repaintCompositedLayers(const IntRect* absRect)
     recursiveRepaintLayer(rootRenderLayer(), absRect);
 }
 
-void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer* layer, const IntRect* rect)
+void RenderLayerCompositor::recursiveRepaintLayer(RenderLayer& layer, const IntRect* rect)
 {
     // FIXME: This method does not work correctly with transforms.
-    if (layer->isComposited() && !layer->backing()->paintsIntoCompositedAncestor()) {
+    if (layer.isComposited() && !layer.backing()->paintsIntoCompositedAncestor()) {
         if (rect)
-            layer->setBackingNeedsRepaintInRect(*rect);
+            layer.setBackingNeedsRepaintInRect(*rect);
         else
-            layer->setBackingNeedsRepaint();
+            layer.setBackingNeedsRepaint();
     }
 
 #if !ASSERT_DISABLED
-    LayerListMutationDetector mutationChecker(layer);
+    LayerListMutationDetector mutationChecker(&layer);
 #endif
 
-    if (layer->hasCompositingDescendant()) {
-        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
-            size_t listSize = negZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = negZOrderList->at(i);
+    if (layer.hasCompositingDescendant()) {
+        if (Vector<RenderLayer*>* negZOrderList = layer.negZOrderList()) {
+            for (size_t i = 0, size = negZOrderList->size(); i < size; ++i) {
+                RenderLayer& childLayer = *negZOrderList->at(i);
                 if (rect) {
                     IntRect childRect(*rect);
-                    curLayer->convertToPixelSnappedLayerCoords(layer, childRect);
-                    recursiveRepaintLayer(curLayer, &childRect);
+                    childLayer.convertToPixelSnappedLayerCoords(&layer, childRect);
+                    recursiveRepaintLayer(childLayer, &childRect);
                 } else
-                    recursiveRepaintLayer(curLayer);
+                    recursiveRepaintLayer(childLayer);
             }
         }
 
-        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
-            size_t listSize = posZOrderList->size();
-            for (size_t i = 0; i < listSize; ++i) {
-                RenderLayer* curLayer = posZOrderList->at(i);
+        if (Vector<RenderLayer*>* posZOrderList = layer.posZOrderList()) {
+            for (size_t i = 0, size = posZOrderList->size(); i < size; ++i) {
+                RenderLayer& childLayer = *posZOrderList->at(i);
                 if (rect) {
                     IntRect childRect(*rect);
-                    curLayer->convertToPixelSnappedLayerCoords(layer, childRect);
-                    recursiveRepaintLayer(curLayer, &childRect);
+                    childLayer.convertToPixelSnappedLayerCoords(&layer, childRect);
+                    recursiveRepaintLayer(childLayer, &childRect);
                 } else
-                    recursiveRepaintLayer(curLayer);
+                    recursiveRepaintLayer(childLayer);
             }
         }
     }
-    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
-        size_t listSize = normalFlowList->size();
-        for (size_t i = 0; i < listSize; ++i) {
-            RenderLayer* curLayer = normalFlowList->at(i);
+    if (Vector<RenderLayer*>* normalFlowList = layer.normalFlowList()) {
+        for (size_t i = 0, size = normalFlowList->size(); i < size; ++i) {
+            RenderLayer& childLayer = *normalFlowList->at(i);
             if (rect) {
                 IntRect childRect(*rect);
-                curLayer->convertToPixelSnappedLayerCoords(layer, childRect);
-                recursiveRepaintLayer(curLayer, &childRect);
+                childLayer.convertToPixelSnappedLayerCoords(&layer, childRect);
+                recursiveRepaintLayer(childLayer, &childRect);
             } else
-                recursiveRepaintLayer(curLayer);
+                recursiveRepaintLayer(childLayer);
         }
     }
 }
 
-RenderLayer* RenderLayerCompositor::rootRenderLayer() const
+RenderLayer& RenderLayerCompositor::rootRenderLayer() const
 {
-    return m_renderView.layer();
+    return *m_renderView.layer();
 }
 
 GraphicsLayer* RenderLayerCompositor::rootGraphicsLayer() const
@@ -1644,7 +1607,7 @@ GraphicsLayer* RenderLayerCompositor::footerLayer() const
 TiledBacking* RenderLayerCompositor::pageTiledBacking() const
 {
     RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();
-    return renderViewBacking ? renderViewBacking->tiledBacking() : 0;
+    return renderViewBacking ? renderViewBacking->tiledBacking() : nullptr;
 }
 
 void RenderLayerCompositor::setIsInWindow(bool isInWindow)
@@ -1669,23 +1632,20 @@ void RenderLayerCompositor::setIsInWindow(bool isInWindow)
     }
 }
 
-void RenderLayerCompositor::clearBackingForLayerIncludingDescendants(RenderLayer* layer)
+void RenderLayerCompositor::clearBackingForLayerIncludingDescendants(RenderLayer& layer)
 {
-    if (!layer)
-        return;
-
-    if (layer->isComposited()) {
+    if (layer.isComposited()) {
         removeViewportConstrainedLayer(layer);
-        layer->clearBacking();
+        layer.clearBacking();
     }
-    
-    for (RenderLayer* currLayer = layer->firstChild(); currLayer; currLayer = currLayer->nextSibling())
-        clearBackingForLayerIncludingDescendants(currLayer);
+
+    for (RenderLayer* childLayer = layer.firstChild(); childLayer; childLayer = childLayer->nextSibling())
+        clearBackingForLayerIncludingDescendants(*childLayer);
 }
 
 void RenderLayerCompositor::clearBackingForAllLayers()
 {
-    clearBackingForLayerIncludingDescendants(m_renderView.layer());
+    clearBackingForLayerIncludingDescendants(*m_renderView.layer());
 }
 
 void RenderLayerCompositor::updateRootLayerPosition()
@@ -1738,7 +1698,7 @@ bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame() const
     // is to have the parent document become composited too. However, this can cause problems on platforms that
     // use native views for frames (like Mac), so disable that behavior on those platforms for now.
     HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement();
-    RenderObject* renderer = ownerElement ? ownerElement->renderer() : 0;
+    RenderElement* renderer = ownerElement ? ownerElement->renderer() : 0;
 
     // If we are the top-level frame, don't propagate.
     if (!ownerElement)
@@ -1767,77 +1727,78 @@ bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame() const
     return false;
 }
 
-bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
+bool RenderLayerCompositor::needsToBeComposited(const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
 {
     if (!canBeComposited(layer))
         return false;
 
-    return requiresCompositingLayer(layer, viewportConstrainedNotCompositedReason) || layer->mustCompositeForIndirectReasons() || (inCompositingMode() && layer->isRootLayer());
+    return requiresCompositingLayer(layer, viewportConstrainedNotCompositedReason) || layer.mustCompositeForIndirectReasons() || (inCompositingMode() && layer.isRootLayer());
 }
 
 // Note: this specifies whether the RL needs a compositing layer for intrinsic reasons.
 // Use needsToBeComposited() to determine if a RL actually needs a compositing layer.
 // static
-bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
+bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
 {
-    RenderObject* renderer = &layer->renderer();
+    auto renderer = &layer.renderer();
+
     // The compositing state of a reflection should match that of its reflected layer.
-    if (layer->isReflection()) {
-        renderer = renderer->parent(); // The RenderReplica's parent is the object being reflected.
-        layer = toRenderLayerModelObject(renderer)->layer();
-    }
+    if (layer.isReflection())
+        renderer = toRenderLayerModelObject(renderer->parent()); // The RenderReplica's parent is the object being reflected.
+
     // The root layer always has a compositing layer, but it may not have backing.
-    return requiresCompositingForTransform(renderer)
-        || requiresCompositingForVideo(renderer)
-        || requiresCompositingForCanvas(renderer)
-        || requiresCompositingForPlugin(renderer)
-        || requiresCompositingForFrame(renderer)
+    return requiresCompositingForTransform(*renderer)
+        || requiresCompositingForVideo(*renderer)
+        || requiresCompositingForCanvas(*renderer)
+        || requiresCompositingForPlugin(*renderer)
+        || requiresCompositingForFrame(*renderer)
         || (canRender3DTransforms() && renderer->style()->backfaceVisibility() == BackfaceVisibilityHidden)
-        || clipsCompositingDescendants(layer)
-        || requiresCompositingForAnimation(renderer)
-        || requiresCompositingForFilters(renderer)
-        || requiresCompositingForPosition(renderer, layer, viewportConstrainedNotCompositedReason)
-        || requiresCompositingForOverflowScrolling(layer)
-        || requiresCompositingForBlending(renderer);
+        || clipsCompositingDescendants(*renderer->layer())
+        || requiresCompositingForAnimation(*renderer)
+        || requiresCompositingForFilters(*renderer)
+        || requiresCompositingForPosition(*renderer, *renderer->layer(), viewportConstrainedNotCompositedReason)
+        || requiresCompositingForOverflowScrolling(*renderer->layer())
+        || requiresCompositingForBlending(*renderer);
 }
 
-bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const
+bool RenderLayerCompositor::canBeComposited(const RenderLayer& layer) const
 {
     // FIXME: We disable accelerated compositing for elements in a RenderFlowThread as it doesn't work properly.
     // See http://webkit.org/b/84900 to re-enable it.
-    return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer->renderer().flowThreadState() == RenderObject::NotInsideFlowThread;
+    return m_hasAcceleratedCompositing && layer.isSelfPaintingLayer() && layer.renderer().flowThreadState() == RenderElement::NotInsideFlowThread;
 }
 
-bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, const RenderLayer* compositingAncestorLayer, const IntRect& layerCompositedBoundsInAncestor, const IntRect& ancestorCompositedBounds) const
+bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer& layer, const RenderLayer* compositingAncestorLayer, const IntRect& layerCompositedBoundsInAncestor, const IntRect& ancestorCompositedBounds) const
 {