Use is<>() / downcast<>() for Document
https://bugs.webkit.org/show_bug.cgi?id=137221
Reviewed by Andreas Kling.
Use is<>() / downcast<>() for Document instead of isDocumentNode() /
toDocument().
Source/WebCore:
No new tests, no behavior change.
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::document):
(WebCore::Geolocation::frame):
(WebCore::Geolocation::page):
* Modules/indexeddb/IDBFactory.cpp:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::document):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection):
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
(WebCore::Notification::show):
(WebCore::Notification::permission):
(WebCore::Notification::requestPermission):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::document):
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::create):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::allowDatabaseAccess):
(WebCore::DatabaseContext::databaseExceededQuota):
* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeMessage):
(WebCore::WebSocketHandshake::clientHandshakeRequest):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* bindings/js/DOMConstructorWithDocument.h:
(WebCore::DOMConstructorWithDocument::document):
* bindings/js/DOMRequestState.h:
(WebCore::DOMRequestState::DOMRequestState):
(WebCore::DOMRequestState::clear):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::constructJSAudioContext):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::toJSDOMGlobalObject):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/js/ScriptState.cpp:
(WebCore::frameFromExecState):
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::document):
* dom/Comment.cpp:
(WebCore::Comment::create):
* dom/ContainerNode.cpp:
(WebCore::checkAcceptChild):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
* dom/Document.h:
(WebCore::isDocument):
* dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::create):
* dom/Element.cpp:
(WebCore::Element::computeInheritedLanguage):
* dom/EventDispatcher.cpp:
(WebCore::WindowEventContext::WindowEventContext):
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/NamedFlowCollection.cpp:
(WebCore::NamedFlowCollection::document):
* dom/Node.cpp:
(WebCore::Node::isDefaultNamespace):
(WebCore::Node::lookupPrefix):
(WebCore::Node::lookupNamespaceURI):
(WebCore::Node::removedLastRef):
* dom/Range.cpp:
(WebCore::Range::create):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::dispatchErrorEvent):
* dom/Text.cpp:
(WebCore::Text::create):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendStartMarkup):
* html/HTMLDocument.h:
(WebCore::isHTMLDocument):
* html/HTMLNameCollection.h:
(WebCore::HTMLNameCollection::document):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedInto):
* html/ImageDocument.h:
(WebCore::isImageDocument):
* html/MediaDocument.h:
(WebCore::isMediaDocument):
* html/PluginDocument.h:
(WebCore::isPluginDocument):
* html/track/TextTrackCue.h:
(WebCore::TextTrackCue::ownerDocument):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::initialize):
* html/track/VTTRegion.h:
(WebCore::VTTRegion::ownerDocument):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::assertDocument):
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::innerParentNode):
* inspector/InspectorInstrumentation.cpp:
(WebCore::frameForScriptExecutionContext):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::corsPolicyPreventedLoad):
(WebCore::TextTrackLoader::notifyFinished):
(WebCore::TextTrackLoader::load):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::create):
(WebCore::ThreadableLoader::loadResourceSynchronously):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader):
* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation):
* page/Crypto.cpp:
(WebCore::Crypto::document):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus):
(WebCore::DOMWindow::close):
(WebCore::DOMWindow::document):
(WebCore::DOMWindow::styleMedia):
(WebCore::DOMWindow::getComputedStyle):
* page/DragController.cpp:
(WebCore::DragController::dragExited):
(WebCore::DragController::dragEnteredOrUpdated):
* page/EventSource.cpp:
(WebCore::EventSource::create):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusDirectionally):
* page/History.cpp:
(WebCore::History::go):
* page/SpatialNavigation.cpp:
(WebCore::scrollInDirection):
(WebCore::scrollableEnclosingBoxOrParentFrameForNodeInDirection):
(WebCore::canScrollInDirection):
(WebCore::nodeRectInAbsoluteCoordinates):
* svg/SVGDocument.h:
(WebCore::isSVGDocument):
* testing/Internals.cpp:
(WebCore::Internals::contextDocument):
(WebCore::Internals::frame):
(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):
(WebCoreTestSupport::resetInternalsObject):
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::addToWorkerDocuments):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::document):
(WebCore::XMLHttpRequest::open):
Source/WebKit2:
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
(-[WKDOMDocument createElement:]):
(-[WKDOMDocument createTextNode:]):
(-[WKDOMDocument body]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
68 files changed