Changeset 154225 in webkit
- Timestamp:
- Aug 17, 2013, 7:37:25 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r154224 r154225 1 2013-08-17 Darin Adler <darin@apple.com> 2 3 <https://webkit.org/b/119942> Remove unnecessary uses of Element::ownerDocument 4 5 Reviewed by Andreas Kling. 6 7 The Element::document is a simpler faster alternative to Element::ownerDocument. 8 The only behavior difference between the two is that ownerDocument returns 0 when 9 called on a Document. 10 11 * html/HTMLMediaElement.cpp: 12 (WebCore::HTMLMediaElement::supportsFocus): Call document instead of ownerDocument. 13 (WebCore::HTMLMediaElement::mediaPlayerOwningDocument): Removed null checking of 14 document and call to ownerDocument, since ownerDocument will never return non-null 15 if document returns null. 16 (WebCore::HTMLMediaElement::mediaPlayerSawUnsupportedTracks): Call document instead 17 of ownerDocument. 18 19 * inspector/DOMEditor.cpp: 20 (WebCore::DOMEditor::SetOuterHTMLAction::perform): Call document instead of ownerDocument. 21 22 * inspector/InspectorCSSAgent.cpp: 23 (WebCore::InspectorCSSAgent::getMatchedStylesForNode): Call document instead of ownerDocument. 24 (WebCore::InspectorCSSAgent::forcePseudoState): Call document instead of ownerDocument. 25 (WebCore::InspectorCSSAgent::resetPseudoStates): Call document instead of ownerDocument. 26 27 * inspector/InspectorDOMAgent.cpp: 28 (WebCore::InspectorDOMAgent::setOuterHTML): Call document instead of expression that 29 does the same thing in a roundabout way. 30 (WebCore::InspectorDOMAgent::focusNode): Call document instead of ownerDocument. 31 (WebCore::InspectorDOMAgent::resolveNode): Call document instead of expression that 32 does the same thing in a roundabout way. 33 34 * page/DragController.cpp: 35 (WebCore::DragController::concludeEditDrag): Call document instead of ownerDocument. 36 37 * svg/SVGElementInstance.cpp: 38 (WebCore::SVGElementInstance::ownerDocument): Call document instead of ownerDocument. 39 1 40 2013-08-17 Darin Adler <darin@apple.com> 2 41 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r154201 r154225 425 425 bool HTMLMediaElement::supportsFocus() const 426 426 { 427 if ( ownerDocument()->isMediaDocument())427 if (document()->isMediaDocument()) 428 428 return false; 429 429 … … 1668 1668 Document* HTMLMediaElement::mediaPlayerOwningDocument() 1669 1669 { 1670 Document* d = document(); 1671 1672 if (!d) 1673 d = ownerDocument(); 1674 1675 return d; 1670 return document(); 1676 1671 } 1677 1672 … … 3768 3763 // This is normally acceptable except when we are in a standalone 3769 3764 // MediaDocument. If so, tell the document what has happened. 3770 if ( ownerDocument()->isMediaDocument()) {3771 MediaDocument* mediaDocument = toMediaDocument( ownerDocument());3765 if (document()->isMediaDocument()) { 3766 MediaDocument* mediaDocument = toMediaDocument(document()); 3772 3767 mediaDocument->mediaElementSawUnsupportedTracks(); 3773 3768 } -
trunk/Source/WebCore/inspector/DOMEditor.cpp
r110854 r154225 221 221 { 222 222 m_oldHTML = createMarkup(m_node.get()); 223 DOMPatchSupport domPatchSupport(m_domEditor.get(), m_node-> ownerDocument());223 DOMPatchSupport domPatchSupport(m_domEditor.get(), m_node->document()); 224 224 m_newNode = domPatchSupport.patchNode(m_node.get(), m_html, ec); 225 225 return !ec; -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r154201 r154225 810 810 811 811 // Matched rules. 812 StyleResolver& styleResolver = element-> ownerDocument()->ensureStyleResolver();812 StyleResolver& styleResolver = element->document()->ensureStyleResolver(); 813 813 Vector<RefPtr<StyleRuleBase> > matchedRules = styleResolver.styleRulesForElement(element, StyleResolver::AllCSSRules); 814 814 matchedCSSRules = buildArrayForMatchedRuleList(matchedRules, styleResolver, element); … … 835 835 Element* parentElement = element->parentElement(); 836 836 while (parentElement) { 837 StyleResolver& parentStyleResolver = parentElement-> ownerDocument()->ensureStyleResolver();837 StyleResolver& parentStyleResolver = parentElement->document()->ensureStyleResolver(); 838 838 Vector<RefPtr<StyleRuleBase> > parentMatchedRules = parentStyleResolver.styleRulesForElement(parentElement, StyleResolver::AllCSSRules); 839 839 RefPtr<TypeBuilder::CSS::InheritedStyleEntry> entry = TypeBuilder::CSS::InheritedStyleEntry::create() … … 1054 1054 else 1055 1055 m_nodeIdToForcedPseudoState.remove(nodeId); 1056 element-> ownerDocument()->styleResolverChanged(RecalcStyleImmediately);1056 element->document()->styleResolverChanged(RecalcStyleImmediately); 1057 1057 } 1058 1058 … … 1455 1455 for (NodeIdToForcedPseudoState::iterator it = m_nodeIdToForcedPseudoState.begin(), end = m_nodeIdToForcedPseudoState.end(); it != end; ++it) { 1456 1456 Element* element = toElement(m_domAgent->nodeForId(it->key)); 1457 if (element && element-> ownerDocument())1458 documentsToChange.add(element-> ownerDocument());1457 if (element && element->document()) 1458 documentsToChange.add(element->document()); 1459 1459 } 1460 1460 -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r154106 r154225 785 785 return; 786 786 787 Document* document = node-> isDocumentNode() ? toDocument(node) : node->ownerDocument();787 Document* document = node->document(); 788 788 if (!document || (!document->isHTMLDocument() && !document->isXHTMLDocument() 789 789 #if ENABLE(SVG) … … 1087 1087 m_nodeToFocus = 0; 1088 1088 1089 Document* document = node-> ownerDocument();1089 Document* document = node->document(); 1090 1090 if (!document) 1091 1091 return; … … 1817 1817 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup) 1818 1818 { 1819 Document* document = node-> isDocumentNode() ? node->document() : node->ownerDocument();1819 Document* document = node->document(); 1820 1820 Frame* frame = document ? document->frame() : 0; 1821 1821 if (!frame) -
trunk/Source/WebCore/page/DragController.cpp
r154224 r154225 463 463 if (!element) 464 464 return false; 465 RefPtr<Frame> innerFrame = element-> ownerDocument()->frame();465 RefPtr<Frame> innerFrame = element->document()->frame(); 466 466 ASSERT(innerFrame); 467 467 -
trunk/Source/WebCore/svg/SVGElementInstance.cpp
r153926 r154225 167 167 Document* SVGElementInstance::ownerDocument() const 168 168 { 169 return m_element ? m_element-> ownerDocument() : 0;169 return m_element ? m_element->document() : 0; 170 170 } 171 171
Note:
See TracChangeset
for help on using the changeset viewer.