Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1137)

Unified Diff: Source/core/html/imports/HTMLImportStateResolver.cpp

Issue 297863004: Merge 174141 "HTML Imports: Take care of cycles according to the..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1985/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/imports/HTMLImportLoader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/imports/HTMLImportStateResolver.cpp
===================================================================
--- Source/core/html/imports/HTMLImportStateResolver.cpp (revision 174593)
+++ Source/core/html/imports/HTMLImportStateResolver.cpp (working copy)
@@ -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 @@
{
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::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()) {
« no previous file with comments | « Source/core/html/imports/HTMLImportLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698