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

Unified Diff: Source/core/html/HTMLLinkElement.cpp

Issue 1060863003: Add initial link preload support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninit member :/ Created 5 years, 8 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/html/HTMLLinkElement.h ('k') | Source/core/html/LinkRelAttribute.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLinkElement.cpp
diff --git a/Source/core/html/HTMLLinkElement.cpp b/Source/core/html/HTMLLinkElement.cpp
index 32b8a63d3b1d2f0307bfd967db1443c576102cb7..914cdf0474ed277fd5f9cf086f7cbdfecc0845af 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -172,6 +172,9 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri
} else if (name == typeAttr) {
m_type = value;
process();
+ } else if (name == asAttr) {
+ m_as = value;
+ process();
} else if (name == sizesAttr) {
m_sizes->setValue(value);
parseSizesAttribute(value, m_iconSizes);
@@ -197,9 +200,9 @@ bool HTMLLinkElement::shouldLoadLink()
return inDocument();
}
-bool HTMLLinkElement::loadLink(const String& type, const KURL& url)
+bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url)
{
- return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::crossoriginAttr), type, url, document());
+ return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::crossoriginAttr), type, as, url, document());
}
LinkResource* HTMLLinkElement::linkResourceToProcess()
@@ -690,6 +693,7 @@ void LinkStyle::process()
{
ASSERT(m_owner->shouldProcessStyle());
String type = m_owner->typeValue().lower();
+ String as = m_owner->asValue().lower();
LinkRequestBuilder builder(m_owner);
if (m_owner->relAttribute().iconType() != InvalidIcon && builder.url().isValid() && !builder.url().isEmpty()) {
@@ -703,7 +707,7 @@ void LinkStyle::process()
document().frame()->loader().client()->dispatchDidChangeIcons(m_owner->relAttribute().iconType());
}
- if (!m_owner->loadLink(type, builder.url()))
+ if (!m_owner->loadLink(type, as, builder.url()))
return;
if ((m_disabledState != Disabled) && (m_owner->relAttribute().isStyleSheet() || m_owner->relAttribute().isTransitionExitingStylesheet())
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | Source/core/html/LinkRelAttribute.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698