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

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

Issue 1032033002: Fire error events for a variety of script and style failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed test failures Created 5 years, 9 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/HTMLStyleElement.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 0907d5b7d6b11032046d6bbcf719ed833770d176..62d4669ae7d84d5afc6d2063d889d4a9a84f1754 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -365,10 +365,10 @@ bool HTMLLinkElement::sheetLoaded()
return linkStyle()->sheetLoaded();
}
-void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
+void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources(LoadedSheetErrorStatus errorStatus)
{
ASSERT(linkStyle());
- linkStyle()->notifyLoadedSheetAndAllCriticalSubresources(errorOccurred);
+ linkStyle()->notifyLoadedSheetAndAllCriticalSubresources(errorStatus);
}
void HTMLLinkElement::dispatchPendingLoadEvents()
@@ -516,7 +516,7 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
if (!cachedStyleSheet->errorOccurred() && !SubresourceIntegrity::CheckSubresourceIntegrity(*m_owner, cachedStyleSheet->sheetText(), KURL(baseURL, href), cachedStyleSheet->mimeType(), *cachedStyleSheet)) {
m_loading = false;
removePendingSheet();
- notifyLoadedSheetAndAllCriticalSubresources(true);
+ notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSubresource);
return;
}
@@ -570,11 +570,11 @@ bool LinkStyle::sheetLoaded()
return false;
}
-void LinkStyle::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
+void LinkStyle::notifyLoadedSheetAndAllCriticalSubresources(Node::LoadedSheetErrorStatus errorStatus)
{
if (m_firedLoad)
return;
- m_loadedSheet = !errorOccurred;
+ m_loadedSheet = (errorStatus == Node::NoErrorLoadingSubresource);
if (m_owner)
m_owner->scheduleEvent();
m_firedLoad = true;
@@ -743,9 +743,10 @@ void LinkStyle::process()
setResource(document().fetcher()->fetchCSSStyleSheet(request));
if (!resource()) {
- // The request may have been denied if (for example) the stylesheet is local and the document is remote.
+ // The request may have been denied if (for example) the stylesheet is local and the document is remote, or if there was a Content Security Policy Failure.
m_loading = false;
removePendingSheet();
+ notifyLoadedSheetAndAllCriticalSubresources(Node::ErrorOccurredLoadingSubresource);
}
} else if (m_sheet) {
// we no longer contain a stylesheet, e.g. perhaps rel or type was changed
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | Source/core/html/HTMLStyleElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698