Index: Source/core/html/imports/HTMLImportChild.cpp |
diff --git a/Source/core/html/imports/HTMLImportChild.cpp b/Source/core/html/imports/HTMLImportChild.cpp |
index 2b0c6c9f653109d295bfaacdb4f0eae67b63f633..4a6b89a5939ae3f0fcc99b0c23fac782fb4e9a38 100644 |
--- a/Source/core/html/imports/HTMLImportChild.cpp |
+++ b/Source/core/html/imports/HTMLImportChild.cpp |
@@ -132,14 +132,14 @@ void HTMLImportChild::importDestroyed() |
} |
} |
-HTMLImportRoot* HTMLImportChild::root() |
+Document* HTMLImportChild::document() const |
{ |
- return parent() ? parent()->root() : 0; |
+ return (m_loader && m_loader->isOwnedBy(this)) ? m_loader->document() : 0; |
} |
-Document* HTMLImportChild::document() const |
+void HTMLImportChild::stateWillChange() |
{ |
- return (m_loader && m_loader->isOwnedBy(this)) ? m_loader->document() : 0; |
+ toHTMLImportsController(root())->scheduleRecalcState(); |
} |
void HTMLImportChild::stateDidChange() |
@@ -160,7 +160,7 @@ void HTMLImportChild::ensureLoader() |
if (m_loader) |
return; |
- if (HTMLImportChild* found = root()->findLinkFor(m_url, this)) |
+ if (HTMLImportChild* found = toHTMLImportsController(root())->findLinkFor(m_url, this)) |
shareLoader(found); |
else |
createLoader(); |
@@ -170,7 +170,7 @@ void HTMLImportChild::createLoader() |
{ |
ASSERT(!state().shouldBlockDocumentCreation()); |
ASSERT(!m_loader); |
- m_loader = root()->toController()->createLoader(); |
+ m_loader = toHTMLImportsController(root())->createLoader(); |
m_loader->addImport(this); |
m_loader->startLoading(resource()); |
} |