Use more references in TreeScope / TreeScopeAdopter
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2016 00:39:55 +0000 (00:39 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2016 00:39:55 +0000 (00:39 +0000)
commit8ddb77ea9ad1c68f7863e81e7008adc773bb3888
treeda200b8bce2048929eb517ab409edc576d0696e2
parentb44916d9da9414affb78b033305bf78bf0545b15
Use more references in TreeScope / TreeScopeAdopter
https://bugs.webkit.org/show_bug.cgi?id=164836

Reviewed by Ryosuke Niwa.

Use more references in TreeScope / TreeScopeAdopter and avoid some
unnecessary null checks.

No new tests, no Web-exposed behavior change.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeBetween):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::parserAppendChild):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::addChildNodesToDeletionQueue):
* dom/Document.cpp:
(WebCore::Document::adoptNode):
(WebCore::Document::moveNodeIteratorsToNewDocument):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::addShadowRoot):
(WebCore::Element::removeShadowRoot):
(WebCore::Element::setAttributeNode):
(WebCore::Element::setAttributeNodeNS):
(WebCore::Element::ensureAttr):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument):
* dom/Node.h:
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::adoptDocument):
* dom/TreeScope.cpp:
(WebCore::TreeScope::TreeScope):
(WebCore::TreeScope::setParentTreeScope):
(WebCore::TreeScope::adoptIfNeeded):
* dom/TreeScope.h:
(WebCore::TreeScope::documentScope):
(WebCore::TreeScope::setDocumentScope):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveShadowTreeToNewDocument):
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::updateTreeScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* dom/TreeScopeAdopter.h:
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::TreeScopeAdopter):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::didMoveToNewDocument):
* html/FormAssociatedElement.h:
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::didMoveToNewDocument):
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didMoveToNewDocument):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::didMoveToNewDocument):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::didMoveToNewDocument):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didMoveToNewDocument):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didMoveToNewDocument):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::didMoveToNewDocument):
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::didMoveToNewDocument):
* html/HTMLPictureElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
* html/HTMLPlugInImageElement.h:
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::didMoveToNewDocument):
* html/HTMLTemplateElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::didMoveToNewDocument):
* html/HTMLVideoElement.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocumentElement::didMoveToNewDocument):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::didMoveToNewDocument):
* svg/SVGImageElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::didMoveToNewDocument):
* svg/SVGSVGElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNodeAlgorithms.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/NodeRareData.h
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/dom/TreeScope.h
Source/WebCore/dom/TreeScopeAdopter.cpp
Source/WebCore/dom/TreeScopeAdopter.h
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/FormAssociatedElement.h
Source/WebCore/html/HTMLFieldSetElement.cpp
Source/WebCore/html/HTMLFieldSetElement.h
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLImageElement.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLObjectElement.h
Source/WebCore/html/HTMLPictureElement.cpp
Source/WebCore/html/HTMLPictureElement.h
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.h
Source/WebCore/html/HTMLTemplateElement.cpp
Source/WebCore/html/HTMLTemplateElement.h
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGImageElement.h
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGSVGElement.h