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

Unified Diff: Source/core/dom/Document.cpp

Issue 202813002: [HTML Import] Let script block by pending resources created by lifecycle callback (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-landing with another fix Created 6 years, 9 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/dom/Document.h ('k') | Source/core/html/imports/HTMLImportsController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index ae93b19406f5fb4cec1ff4c2a7aa9be222f4e7f1..a98a967fb804e1022860fd098a56c818aaa3bfc0 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -816,11 +816,6 @@ void Document::setImport(HTMLImport* import)
m_import = import;
}
-void Document::didLoadAllImports()
-{
- executeScriptsWaitingForResourcesIfNeeded();
-}
-
bool Document::haveImportsLoaded() const
{
return !m_import || !m_import->state().shouldBlockScriptExecution();
@@ -2845,20 +2840,37 @@ LocalFrame* Document::findUnsafeParentScrollPropagationBoundary()
return 0;
}
+void Document::didLoadAllImports()
+{
+ if (!haveStylesheetsLoaded())
+ return;
+
+ didLoadAllScriptBlockingResources();
+}
+
void Document::didRemoveAllPendingStylesheet()
{
m_needsNotifyRemoveAllPendingStylesheet = false;
styleResolverChanged(RecalcStyleDeferred, hasNodesWithPlaceholderStyle() ? FullStyleUpdate : AnalyzedStyleUpdate);
+
+ if (m_import)
+ m_import->didRemoveAllPendingStylesheet();
+ if (!haveImportsLoaded())
+ return;
+
+ didLoadAllScriptBlockingResources();
+}
+
+void Document::didLoadAllScriptBlockingResources()
+{
executeScriptsWaitingForResourcesIfNeeded();
if (m_gotoAnchorNeededAfterStylesheetsLoad && view())
view()->scrollToFragment(m_url);
-
- if (m_import)
- m_import->didRemoveAllPendingStylesheet();
}
+
void Document::executeScriptsWaitingForResourcesIfNeeded()
{
if (!haveStylesheetsAndImportsLoaded())
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/html/imports/HTMLImportsController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698