Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / HTMLImportChild.cpp
index c752a52..3a80baf 100644 (file)
@@ -86,7 +86,7 @@ void HTMLImportChild::startLoading(const ResourcePtr<RawResource>& resource)
     // preceding imports load the sharable imports.
     // In that case preceding one should win because it comes first in the tree order.
     // See also didUnblockFromCreatingDocument().
-    if (isStateBlockedFromCreatingDocument())
+    if (state().shouldBlockDocumentCreation())
         return;
 
     ensureLoader();
@@ -156,9 +156,9 @@ void HTMLImportChild::stateDidChange()
     // Once all preceding imports are loaded,
     // HTMLImportChild can decide whether it should load the import by itself
     // or it can share existing one.
-    if (!isStateBlockedFromCreatingDocument())
+    if (!state().shouldBlockDocumentCreation())
         ensureLoader();
-    if (isStateReady())
+    if (state().isReady())
         didFinish();
 }
 
@@ -175,7 +175,7 @@ void HTMLImportChild::ensureLoader()
 
 void HTMLImportChild::createLoader()
 {
-    ASSERT(!isStateBlockedFromCreatingDocument());
+    ASSERT(!state().shouldBlockDocumentCreation());
     ASSERT(!m_loader);
     m_loader = HTMLImportLoader::create(this);
     m_loader->addClient(this);
@@ -202,7 +202,7 @@ bool HTMLImportChild::hasLoader() const
 
 bool HTMLImportChild::ownsLoader() const
 {
-    return m_loader->isOwnedBy(this);
+    return m_loader && m_loader->isOwnedBy(this);
 }
 
 bool HTMLImportChild::loaderHasError() const
@@ -225,6 +225,12 @@ void HTMLImportChild::clearClient()
     m_client = 0;
 }
 
+HTMLLinkElement* HTMLImportChild::link() const
+{
+    if (!m_client)
+        return 0;
+    return m_client->link();
+}
 
 #if !defined(NDEBUG)
 void HTMLImportChild::showThis()