<https://webkit.org/b/119942> Remove unnecessary uses of Element::ownerDocument
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Aug 2013 14:37:25 +0000 (14:37 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Aug 2013 14:37:25 +0000 (14:37 +0000)
commitdc20e2c1fbfac3c77f324b5b262e13e521681b27
tree7399c781d218a69f193d9044cfee91dbf31ad3b8
parentbe92720f7159daddd9cf2d1571bd3e21c15669f7
<https://webkit.org/b/119942> Remove unnecessary uses of Element::ownerDocument

Reviewed by Andreas Kling.

The Element::document is a simpler faster alternative to Element::ownerDocument.
The only behavior difference between the two is that ownerDocument returns 0 when
called on a Document.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::supportsFocus): Call document instead of ownerDocument.
(WebCore::HTMLMediaElement::mediaPlayerOwningDocument): Removed null checking of
document and call to ownerDocument, since ownerDocument will never return non-null
if document returns null.
(WebCore::HTMLMediaElement::mediaPlayerSawUnsupportedTracks): Call document instead
of ownerDocument.

* inspector/DOMEditor.cpp:
(WebCore::DOMEditor::SetOuterHTMLAction::perform): Call document instead of ownerDocument.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode): Call document instead of ownerDocument.
(WebCore::InspectorCSSAgent::forcePseudoState): Call document instead of ownerDocument.
(WebCore::InspectorCSSAgent::resetPseudoStates): Call document instead of ownerDocument.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setOuterHTML): Call document instead of expression that
does the same thing in a roundabout way.
(WebCore::InspectorDOMAgent::focusNode): Call document instead of ownerDocument.
(WebCore::InspectorDOMAgent::resolveNode): Call document instead of expression that
does the same thing in a roundabout way.

* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag): Call document instead of ownerDocument.

* svg/SVGElementInstance.cpp:
(WebCore::SVGElementInstance::ownerDocument): Call document instead of ownerDocument.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/inspector/DOMEditor.cpp
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/svg/SVGElementInstance.cpp