Index: Source/core/html/imports/HTMLImportStateResolver.cpp |
diff --git a/Source/core/html/imports/HTMLImportStateResolver.cpp b/Source/core/html/imports/HTMLImportStateResolver.cpp |
index bd083ad51017512e6f430a5ad1c36a2eb6e6165f..df03643504e0a68fd7e00a2fe6c8146dd02f41de 100644 |
--- a/Source/core/html/imports/HTMLImportStateResolver.cpp |
+++ b/Source/core/html/imports/HTMLImportStateResolver.cpp |
@@ -32,6 +32,7 @@ |
#include "core/html/imports/HTMLImportStateResolver.h" |
#include "core/html/imports/HTMLImport.h" |
+#include "core/html/imports/HTMLImportChild.h" |
namespace WebCore { |
@@ -39,6 +40,8 @@ inline bool HTMLImportStateResolver::isBlockingFollowers(HTMLImport* import) |
{ |
if (!import->isSync()) |
return false; |
+ if (!toHTMLImportChild(import)->isFirst()) |
+ return false; |
if (!import->loader()) |
return true; |
return !import->state().isReady(); |
@@ -46,9 +49,12 @@ inline bool HTMLImportStateResolver::isBlockingFollowers(HTMLImport* import) |
inline bool HTMLImportStateResolver::shouldBlockScriptExecution() const |
{ |
- for (const HTMLImport* ancestor = m_import; ancestor; ancestor = ancestor->parent()) { |
- if (ancestor->previous() && isBlockingFollowers(ancestor->previous())) |
- return true; |
+ // FIXME: Memoize to make this faster. |
+ for (HTMLImport* ancestor = m_import; ancestor; ancestor = ancestor->parent()) { |
+ for (HTMLImport* predecessor = ancestor->previous(); predecessor; predecessor = predecessor->previous()) { |
+ if (isBlockingFollowers(predecessor)) |
+ return true; |
+ } |
} |
for (HTMLImport* child = m_import->firstChild(); child; child = child->next()) { |