Index: third_party/WebKit/Source/core/html/imports/LinkImport.cpp |
diff --git a/third_party/WebKit/Source/core/html/imports/LinkImport.cpp b/third_party/WebKit/Source/core/html/imports/LinkImport.cpp |
index c6cc63a09662d64e7bd98bf4c7948e57eacac3c8..8dad36ee3485614500bcb4a00e41bacdedda01ee 100644 |
--- a/third_party/WebKit/Source/core/html/imports/LinkImport.cpp |
+++ b/third_party/WebKit/Source/core/html/imports/LinkImport.cpp |
@@ -30,12 +30,15 @@ |
#include "core/html/imports/LinkImport.h" |
+#include "core/HTMLNames.h" |
#include "core/dom/Document.h" |
+#include "core/fetch/FetchRequest.h" |
#include "core/html/HTMLLinkElement.h" |
#include "core/html/imports/HTMLImportChild.h" |
#include "core/html/imports/HTMLImportLoader.h" |
#include "core/html/imports/HTMLImportTreeRoot.h" |
#include "core/html/imports/HTMLImportsController.h" |
+#include "platform/weborigin/KURL.h" |
namespace blink { |
@@ -61,27 +64,25 @@ void LinkImport::process() { |
return; |
if (!m_owner) |
return; |
- if (!shouldLoadResource()) |
- return; |
if (!m_owner->document().importsController()) { |
+ if (!m_owner->document().frame()) |
+ return; |
+ |
// The document should be the master. |
Document& master = m_owner->document(); |
DCHECK(master.frame()); |
master.createImportsController(); |
} |
- LinkRequestBuilder builder(m_owner); |
- if (!builder.isValid()) { |
+ const KURL& url = m_owner->getNonEmptyURLAttribute(HTMLNames::hrefAttr); |
+ if (url.isEmpty() || !url.isValid()) { |
didFinish(); |
return; |
} |
HTMLImportsController* controller = m_owner->document().importsController(); |
- HTMLImportLoader* loader = m_owner->document().importLoader(); |
- HTMLImport* parent = loader ? static_cast<HTMLImport*>(loader->firstImport()) |
- : static_cast<HTMLImport*>(controller->root()); |
- m_child = controller->load(parent, this, builder.build(false)); |
+ m_child = controller->load(this, m_owner->createFetchRequest()); |
if (!m_child) { |
didFinish(); |
return; |