12012-06-12 Hajime Morrita <morrita@chromium.org>
2
3 [Refactoring] Replace Node's Document pointer with a TreeScope pointer.
4 https://bugs.webkit.org/show_bug.cgi?id=59816
5
6 Now Node::document() return m_treeScope->rootTreeScope() instead of Node::m_document.
7 Each node in shadow tree is no longer need its NodeRareData instance to point the ShadowRoot.
8
9 - Node: Replaced Node::m_docuent with Node::m_treeScope. setDocument() is gone.
10 - NodeRareData: Removed m_treeScope
11 - TreeScope: Added m_rootTreeScope to make Node::document() fast.
12
13 Reviewed by NOBODY (OOPS!).
14
15 No new tests. No behavioral change.
16
17 * dom/Document.cpp:
18 (WebCore::Document::Document):
19 (WebCore::Document::~Document):
20 (WebCore::Document::suggestedMIMEType):
21 * dom/Document.h:
22 (WebCore::Node::isDocumentNode):
23 (WebCore::Node::document):
24 (WebCore::Node::documentInternal):
25 (WebCore::Node::Node):
26 (WebCore::TreeScope::isDocumentScope):
27 * dom/Node.cpp:
28 (WebCore::Node::~Node):
29 (WebCore::Node::isInShadowTree):
30 * dom/Node.h:
31 (WebCore::Node::treeScope):
32 (WebCore::Node::inDocument):
33 (WebCore::Node::setTreeScope):
34 * dom/NodeRareData.h:
35 (WebCore::NodeRareData::NodeRareData):
36 * dom/ShadowRoot.cpp:
37 (WebCore::ShadowRoot::ShadowRoot):
38 * dom/TreeScope.cpp: Added m_docuent which points the root Document object of the scope tree.
39 (WebCore::TreeScope::TreeScope):
40 (WebCore::TreeScope::~TreeScope):
41 (WebCore::TreeScope::setDocument):
42 (WebCore::TreeScope::setParentTreeScope):
43 * dom/TreeScope.h:
44 (WebCore::TreeScope::document):
45 * dom/TreeScopeAdopter.cpp:
46 (WebCore::TreeScopeAdopter::moveTreeToNewScope):
47 (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
48 (WebCore::TreeScopeAdopter::moveNodeListCaches): Extracted.
49 * dom/TreeScopeAdopter.h:
50