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

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 0b4277c3be96e0c2a25dc71792fb3cf47fdc8481..02667368f266bdd80c19fbfe481a2b870f0c8372 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2998,7 +2998,8 @@ void Document::didLoadAllImports()
{
if (!haveStylesheetsLoaded())
return;
- setNeedsStyleRecalc(SubtreeStyleChange);
+ if (!importLoader())
+ styleResolverMayHaveChanged();
didLoadAllScriptBlockingResources();
}
@@ -3006,11 +3007,11 @@ 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();
@@ -3465,6 +3466,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