| Index: Source/core/html/parser/HTMLResourcePreloader.cpp
|
| diff --git a/Source/core/html/parser/HTMLResourcePreloader.cpp b/Source/core/html/parser/HTMLResourcePreloader.cpp
|
| index e79c9985c63ba87f50dc97376742cee189a619da..e79fd161a9d1e37f2973830f83ae2f80b7bcc82f 100644
|
| --- a/Source/core/html/parser/HTMLResourcePreloader.cpp
|
| +++ b/Source/core/html/parser/HTMLResourcePreloader.cpp
|
| @@ -27,9 +27,9 @@
|
| #include "core/html/parser/HTMLResourcePreloader.h"
|
|
|
| #include "core/dom/Document.h"
|
| +#include "core/html/HTMLImport.h"
|
| #include "core/loader/cache/CachedResourceInitiatorInfo.h"
|
| #include "core/loader/cache/ResourceFetcher.h"
|
| -
|
| #include "core/css/MediaList.h"
|
| #include "core/css/MediaQueryEvaluator.h"
|
| #include "core/rendering/RenderObject.h"
|
| @@ -82,14 +82,17 @@ static bool mediaAttributeMatches(Frame* frame, RenderStyle* renderStyle, const
|
|
|
| void HTMLResourcePreloader::preload(PassOwnPtr<PreloadRequest> preload)
|
| {
|
| - ASSERT(m_document->frame());
|
| - ASSERT(m_document->renderer());
|
| - ASSERT(m_document->renderer()->style());
|
| - if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->renderer()->style(), preload->media()))
|
| + Document* executingDocument = m_document->import() ? m_document->import()->master() : m_document;
|
| + Document* loadingDocument = m_document;
|
| +
|
| + ASSERT(executingDocument->frame());
|
| + ASSERT(executingDocument->renderer());
|
| + ASSERT(executingDocument->renderer()->style());
|
| + if (!preload->media().isEmpty() && !mediaAttributeMatches(executingDocument->frame(), executingDocument->renderer()->style(), preload->media()))
|
| return;
|
|
|
| FetchRequest request = preload->resourceRequest(m_document);
|
| - m_document->fetcher()->preload(preload->resourceType(), request, preload->charset());
|
| + loadingDocument->fetcher()->preload(preload->resourceType(), request, preload->charset());
|
| }
|
|
|
|
|
|
|