Index: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
index 1dbb604cf43a662629a8c84f71bcc1d9d427534e..2d41712a45527ab77aed94835787d59810dec28f 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
@@ -44,6 +44,7 @@ |
#include "core/frame/SubresourceIntegrity.h" |
#include "core/frame/UseCounter.h" |
#include "core/frame/csp/ContentSecurityPolicy.h" |
+#include "core/html/CrossOriginAttribute.h" |
#include "core/html/LinkManifest.h" |
#include "core/html/imports/LinkImport.h" |
#include "core/inspector/ConsoleMessage.h" |
@@ -202,7 +203,7 @@ bool HTMLLinkElement::shouldLoadLink() |
bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url) |
{ |
- return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::crossoriginAttr), type, as, url, document(), NetworkHintsInterfaceImpl()); |
+ return m_linkLoader.loadLink(m_relAttribute, crossOriginAttributeValue(fastGetAttribute(HTMLNames::crossoriginAttr)), type, as, url, document(), NetworkHintsInterfaceImpl()); |
} |
LinkResource* HTMLLinkElement::linkResourceToProcess() |
@@ -724,9 +725,9 @@ void LinkStyle::process() |
// Load stylesheets that are not needed for the layout immediately with low priority. |
FetchRequest request = builder.build(blocking); |
- AtomicString crossOriginMode = m_owner->fastGetAttribute(HTMLNames::crossoriginAttr); |
- if (!crossOriginMode.isNull()) { |
- request.setCrossOriginAccessControl(document().securityOrigin(), crossOriginMode); |
+ CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(m_owner->fastGetAttribute(HTMLNames::crossoriginAttr)); |
+ if (crossOrigin != CrossOriginAttributeNotSet) { |
+ request.setCrossOriginAccessControl(document().securityOrigin(), crossOrigin); |
setFetchFollowingCORS(); |
} |
setResource(CSSStyleSheetResource::fetch(request, document().fetcher())); |