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

Unified Diff: Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 976263002: HTML Imports: Teach preloader about HTML Imports. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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 | « LayoutTests/http/tests/resources/redirect.php ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLPreloadScanner.cpp
diff --git a/Source/core/html/parser/HTMLPreloadScanner.cpp b/Source/core/html/parser/HTMLPreloadScanner.cpp
index 198db469d2f222fd40d57dc782932981e65af34f..0b4501268feef16777eac6d4a13f900668622b68 100644
--- a/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -112,6 +112,7 @@ public:
: m_tagImpl(tagImpl)
, m_linkIsStyleSheet(false)
, m_linkIsPreconnect(false)
+ , m_linkIsImport(false)
, m_matchedMediaAttribute(true)
, m_inputIsImage(false)
, m_sourceSize(0)
@@ -236,6 +237,7 @@ private:
LinkRelAttribute rel(attributeValue);
m_linkIsStyleSheet = rel.isStyleSheet() && !rel.isAlternate() && rel.iconType() == InvalidIcon && !rel.isDNSPrefetch();
m_linkIsPreconnect = rel.isPreconnect();
+ m_linkIsImport = rel.isImport();
} else if (match(attributeName, mediaAttr)) {
m_matchedMediaAttribute = mediaAttributeMatches(*m_mediaValues, attributeValue);
} else if (match(attributeName, crossoriginAttr)) {
@@ -328,6 +330,8 @@ private:
return Resource::CSSStyleSheet;
if (m_linkIsPreconnect)
return Resource::Raw;
+ if (match(m_tagImpl, linkTag) && m_linkIsImport)
+ return Resource::ImportResource;
ASSERT_NOT_REACHED();
return Resource::Raw;
}
@@ -341,7 +345,7 @@ private:
{
if (m_urlToLoad.isEmpty())
return false;
- if (match(m_tagImpl, linkTag) && !m_linkIsStyleSheet)
+ if (match(m_tagImpl, linkTag) && !m_linkIsStyleSheet && !m_linkIsImport)
return false;
if (match(m_tagImpl, inputTag) && !m_inputIsImage)
return false;
@@ -383,6 +387,7 @@ private:
String m_charset;
bool m_linkIsStyleSheet;
bool m_linkIsPreconnect;
+ bool m_linkIsImport;
bool m_matchedMediaAttribute;
bool m_inputIsImage;
String m_imgSrcUrl;
« no previous file with comments | « LayoutTests/http/tests/resources/redirect.php ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698