Introduce dynamicDowncast<>() for convenience
https://bugs.webkit.org/show_bug.cgi?id=235259
Reviewed by Darin Adler.
Source/WebCore:
Start adopting dynamicDowncast<>().
- animation/WebAnimation.cpp:
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::willChangeRenderer):
(WebCore::WebAnimation::timingDidChange):
(WebCore::WebAnimation::invalidateEffect):
(WebCore::WebAnimation::finishNotificationSteps):
(WebCore::WebAnimation::resolve):
(WebCore::WebAnimation::persist):
(WebCore::WebAnimation::commitStyles):
- bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
- bindings/js/JSLazyEventListener.cpp:
(WebCore::isCloneInShadowTreeOfSVGUseElement):
(WebCore::JSLazyEventListener::initializeJSFunction const):
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSStyleSheet::insertRule):
(WebCore::Attr::style):
- dom/BroadcastChannel.cpp:
(WebCore::BroadcastChannel::MainThreadBridge::ensureOnMainThread):
(WebCore::BroadcastChannel::isEligibleForMessaging const):
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
(WebCore::Node::length const):
- dom/ComposedTreeAncestorIterator.h:
(WebCore::ComposedTreeAncestorIterator::traverseParent):
(WebCore::ComposedTreeAncestorAdapter::begin):
- dom/ComposedTreeIterator.h:
(WebCore::firstChildInComposedTreeIgnoringUserAgentShadow):
(WebCore::ContainerNode::removeNodeWithScriptAssertion):
(WebCore::ContainerNode::removeSelfOrChildNodesForInsertion):
(WebCore::destroyRenderTreeIfNeeded):
(WebCore::containsIncludingHostElements):
(WebCore::checkAcceptChild):
(WebCore::Node::countChildNodes const):
(WebCore::Node::traverseToChildAt const):
(WebCore::Node::firstChild const):
(WebCore::Node::lastChild const):
(WebCore::widgetForElement):
(WebCore::Document::buildAccessKeyCache):
(WebCore::Document::adjustFocusedNodeOnNodeRemoval):
(WebCore::Element::insertedIntoAncestor):
(WebCore::Element::removedFromAncestor):
(WebCore::Node::parentElement const):
(WebCore::EventDispatcher::dispatchEvent):
(WebCore::MouseEvent::toElement const):
(WebCore::MouseEvent::fromElement const):
(WebCore::Node::renderBox const):
(WebCore::Node::renderBoxModelObject const):
(WebCore::Node::containingShadowRoot const):
(WebCore::Node::compareDocumentPosition):
(WebCore::Position::containerText const):
- dom/TextNodeTraversal.cpp:
(WebCore::TextNodeTraversal::contentsAsString):
(WebCore::TreeScope::elementsFromPoint):
- dom/TypedElementDescendantIterator.h:
(WebCore::ElementDescendantRange<ElementType>::from const):
(WebCore::InclusiveElementDescendantRange<ElementType>::from const):
- dom/VisitedLinkState.cpp:
(WebCore::linkHashForElement):
- dom/messageports/MessagePortChannelProvider.cpp:
(WebCore::MessagePortChannelProvider::fromContext):
(WebCore::enclosingBlock):
- html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::ownerSelectElement const):
- html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::renderEmbeddedObject const):
- html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
- page/AutoscrollController.cpp:
(WebCore::AutoscrollController::updateAutoscrollRenderer):
(WebCore::DOMTimer::fired):
(WebCore::asFileInput):
(WebCore::DragController::operationForLoad):
(WebCore::ScopedNodeDragEnabler::ScopedNodeDragEnabler):
- platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
- rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::computeLogicalBoxHeights):
(WebCore::placeChildInlineBoxesInBlockDirection):
- rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::RenderBlockFlow::marginValuesForChild const):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBox::findAutoscrollable):
- rendering/RenderElement.cpp:
(WebCore::RenderElement::imageOrientation const):
- rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::uploadButton const):
- rendering/RenderImage.cpp:
(WebCore::RenderImage::updateInnerContentRect):
(WebCore::RenderImage::paintIntoRect):
- rendering/RenderInline.cpp:
(WebCore::RenderInline::mayAffectLayout const):
(WebCore::RenderLayer::renderBox const):
- rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
- rendering/RenderListItem.cpp:
(WebCore::RenderListItem::updateValueNow const):
- rendering/RenderObject.cpp:
(WebCore::RenderObject::offsetParent const):
- rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::table const):
- rendering/RenderTreeAsText.cpp:
(WebCore::writeDebugInfo):
- rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
- rendering/SelectionRangeData.cpp:
(WebCore::containingBlockBelowView):
- rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange):
- rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::Parent::Parent):
- style/ChildChangeInvalidation.h:
(WebCore::Style::ChildChangeInvalidation::ChildChangeInvalidation):
(WebCore::SVGSVGElement::findViewAnchor const):
(WebCore::SVGSVGElement::findRootAnchor const):
(WebCore::bitmapImageFromImageElement):
(WebCore::pdfDocumentImageFromImageElement):
Source/WebKit:
Start adopting dynamicDowncast<>().
- WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::didEnterFullScreen):
- WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::paymentCoordinator):
Source/WebKitLegacy/mac:
Start adopting dynamicDowncast<>().
- DOM/DOMUIKitExtensions.mm:
(-[DOMHTMLElement structuralComplexityContribution]):
- WebView/WebHTMLRepresentation.mm:
(inputElementFromDOMElement):
Source/WTF:
Introduce dynamicDowncast<>() for convenience. It can result in more concise code for the common pattern
where we call is<T>(x)
and then downcast<T>(x)
.
(WTF::dynamicDowncast):