Use is<>() / downcast<>() for Document
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Sep 2014 22:23:20 +0000 (22:23 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Sep 2014 22:23:20 +0000 (22:23 +0000)
commitf625dfc3f953be34de348992c242fc59570e732d
tree9459c59383cef31fbbab3be338aecb51d37a66fe
parentd51a846655580edee238e7e3a18e677057066cb0
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: https://svn.webkit.org/repository/webkit/trunk@174089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
68 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/geolocation/Geolocation.cpp
Source/WebCore/Modules/indexeddb/IDBFactory.cpp
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp
Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp
Source/WebCore/bindings/js/DOMConstructorWithDocument.h
Source/WebCore/bindings/js/DOMRequestState.h
Source/WebCore/bindings/js/JSAudioContextCustom.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSLazyEventListener.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/ScheduledAction.cpp
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/crypto/SubtleCrypto.cpp
Source/WebCore/dom/Comment.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNodeAlgorithms.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/DocumentFragment.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/NamedFlowCollection.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/Text.cpp
Source/WebCore/editing/MarkupAccumulator.cpp
Source/WebCore/html/HTMLDocument.h
Source/WebCore/html/HTMLNameCollection.h
Source/WebCore/html/ImageDocument.h
Source/WebCore/html/MediaDocument.h
Source/WebCore/html/PluginDocument.h
Source/WebCore/html/track/TextTrackCue.h
Source/WebCore/html/track/VTTCue.cpp
Source/WebCore/html/track/VTTRegion.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/loader/TextTrackLoader.cpp
Source/WebCore/loader/ThreadableLoader.cpp
Source/WebCore/loader/WorkerThreadableLoader.cpp
Source/WebCore/page/ContentSecurityPolicy.cpp
Source/WebCore/page/Crypto.cpp
Source/WebCore/page/DOMTimer.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/History.cpp
Source/WebCore/page/SpatialNavigation.cpp
Source/WebCore/svg/SVGDocument.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/js/WebCoreTestSupport.cpp
Source/WebCore/workers/DefaultSharedWorkerRepository.cpp
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm