angler-fishThe Vulnerability History Project

https://bugs.webkit.org/show_bug.cgi?id=74067

      Refactoring: Unitfy willMoveToNewDocument() and didMoveToNewDocument()

Patch by Hajime Morrita <morrita@chromium.org> on 2011-12-25
Reviewed by Darin Adler.

No new tests. No behavior change.

This change combines two method Node::willMoveToNewOwnerDocument() and Node::didMoveToNewOwnerDocument()
into Node::didMoveToNewDocument(Document* oldDocument).

The intention of this change is:
- Making upcoming refactoring (Bug 59816) possible. The refactoring will turn Node::m_document into
  Node::m_treeScope, and we will no longer have Node::setDocument() where we can invoke both
  willMoveToNewDocument() and didMoveToNewDocument() at once.
- Killing one extra virtual method call.
- Making the concept of &quotmove&quot clearer by keeping such an operation into the single method.

* dom/Node.cpp:
(WebCore::setWillMoveToNewDocumentWasCalled):
(WebCore::setDidMoveToNewDocumentWasCalled):
(WebCore::Node::setDocument):
(WebCore::Node::didMoveToNewDocument):
* dom/Node.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::didMoveToNewDocument):
* html/FormAssociatedElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didMoveToNewDocument):
(WebCore::HTMLFormControlElementWithState::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/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageEl
    
commit e92208d3534e3f78d7340d662b21085b9f609f84
-69
+27 -14
+2 -1
+1 -1
+3 -3
+1 -1
+11 -7
+3 -2
+10 -7
+2 -1
+3 -3
+1 -1
+14 -11
+2 -1
+15 -19
+3 -1
+3 -3
+2 -2
+14 -8
+2 -1
+3 -3
+3 -1
+3 -3
+1 -1
+1 -1
+1 -1
+3 -3
+1 -1
+7 -6
+2 -1
expand_less