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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp

Issue 1420073002: Make sure StyleResolver sets viewport before initializing HTMLPreloadScanner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « content/test/data/resource_loading/resource_loading_non_mobile.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
index 80f5c230a6944b5491b1c1372e8246f6ea88a9bc..eb7792f2c7c69f605775427e9224eb63bfa1596d 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -778,6 +778,9 @@ void HTMLDocumentParser::startBackgroundParser()
ASSERT(document());
m_haveBackgroundParser = true;
+ // Make sure that a resolver is set up, so that the correct viewport dimensions will be fed to the background parser and preload scanner.
+ document()->ensureStyleResolver();
+
RefPtr<WeakReference<BackgroundHTMLParser>> reference = WeakReference<BackgroundHTMLParser>::createUnbound();
m_backgroundParser = WeakPtr<BackgroundHTMLParser>(reference);
@@ -792,6 +795,7 @@ void HTMLDocumentParser::startBackgroundParser()
config->parser = m_weakFactory.createWeakPtr();
config->xssAuditor = adoptPtr(new XSSAuditor);
config->xssAuditor->init(document(), &m_xssAuditorDelegate);
+
bokan 2015/10/22 16:56:46 Nit: Remove extra space?
config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url().copy(), CachedDocumentParameters::create(document())));
config->decoder = takeDecoder();
if (document()->settings()) {
« no previous file with comments | « content/test/data/resource_loading/resource_loading_non_mobile.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698