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

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

Issue 279463002: HTML Imports: Fix yet another FOUC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 71567f2c817baf5835e37879c87d02f0d501779f..e2b105cf95864370ca5decaee72535fcaad91b54 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2992,7 +2992,8 @@ void Document::didLoadAllImports()
{
if (!haveStylesheetsLoaded())
return;
-
+ if (!importLoader())
+ styleResolverMayHaveChanged();
didLoadAllScriptBlockingResources();
}
@@ -3000,14 +3001,13 @@ void Document::didRemoveAllPendingStylesheet()
{
m_needsNotifyRemoveAllPendingStylesheet = false;
- styleResolverChanged(RecalcStyleDeferred, hasNodesWithPlaceholderStyle() ? FullStyleUpdate : AnalyzedStyleUpdate);
+ styleResolverMayHaveChanged();
+ // Only imports on master documents can trigger rendering.
if (HTMLImportLoader* import = importLoader())
import->didRemoveAllPendingStylesheet();
-
if (!haveImportsLoaded())
return;
-
didLoadAllScriptBlockingResources();
}
@@ -3460,6 +3460,11 @@ void Document::styleResolverChanged(RecalcStyleTime updateTime, StyleResolverUpd
updateRenderTreeIfNeeded();
}
+void Document::styleResolverMayHaveChanged()
+{
+ styleResolverChanged(RecalcStyleDeferred, hasNodesWithPlaceholderStyle() ? FullStyleUpdate : AnalyzedStyleUpdate);
+}
+
void Document::setHoverNode(PassRefPtr<Node> newHoverNode)
{
m_hoverNode = newHoverNode;
« LayoutTests/fast/html/imports/import-link-with-media-query.html ('K') | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698