Index: Source/core/html/imports/HTMLImportTreeRoot.cpp |
diff --git a/Source/core/html/imports/HTMLImportTreeRoot.cpp b/Source/core/html/imports/HTMLImportTreeRoot.cpp |
index d44d93291be97f173f54b87f1c95423d30bae3a6..c28b5203dbd972e00254d35430ca78597a780f14 100644 |
--- a/Source/core/html/imports/HTMLImportTreeRoot.cpp |
+++ b/Source/core/html/imports/HTMLImportTreeRoot.cpp |
@@ -8,6 +8,7 @@ |
#include "core/dom/Document.h" |
#include "core/dom/StyleEngine.h" |
#include "core/frame/LocalFrame.h" |
+#include "core/html/imports/HTMLImportChild.h" |
namespace WebCore { |
@@ -24,6 +25,13 @@ HTMLImportTreeRoot::HTMLImportTreeRoot(Document* document) |
recalcTreeState(this); // This recomputes initial state. |
} |
+HTMLImportTreeRoot::~HTMLImportTreeRoot() |
+{ |
+ for (size_t i = 0; i < m_imports.size(); ++i) |
+ m_imports[i]->importDestroyed(); |
+ m_imports.clear(); |
+} |
+ |
Document* HTMLImportTreeRoot::document() const |
{ |
return m_document; |
@@ -56,6 +64,23 @@ void HTMLImportTreeRoot::scheduleRecalcState() |
m_recalcTimer.startOneShot(0, FROM_HERE); |
} |
+HTMLImportChild* HTMLImportTreeRoot::add(PassOwnPtr<HTMLImportChild> child) |
+{ |
+ m_imports.append(child); |
+ return m_imports.last().get(); |
+} |
+ |
+HTMLImportChild* HTMLImportTreeRoot::find(const KURL& url) const |
+{ |
+ for (size_t i = 0; i < m_imports.size(); ++i) { |
+ HTMLImportChild* candidate = m_imports[i].get(); |
+ if (equalIgnoringFragmentIdentifier(candidate->url(), url)) |
+ return candidate; |
+ } |
+ |
+ return 0; |
+} |
+ |
void HTMLImportTreeRoot::recalcTimerFired(Timer<HTMLImportTreeRoot>*) |
{ |
ASSERT(m_document); |