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

Unified Diff: Source/core/html/HTMLStyleElement.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/HTMLStyleElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLStyleElement.cpp
diff --git a/Source/core/html/HTMLStyleElement.cpp b/Source/core/html/HTMLStyleElement.cpp
index 55434df8e545cae9d56ccba1edb8d19f5a580c37..2d6b0366b2c7dfb82f4dc3a313d291c0a170a04d 100644
--- a/Source/core/html/HTMLStyleElement.cpp
+++ b/Source/core/html/HTMLStyleElement.cpp
@@ -77,8 +77,10 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr
void HTMLStyleElement::finishParsingChildren()
{
- StyleElement::finishParsingChildren(this);
+ StyleElement::ProcessingResult result = StyleElement::finishParsingChildren(this);
HTMLElement::finishParsingChildren();
+ if (result == StyleElement::ProcessingFatalError)
+ notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresource);
}
Node::InsertionNotificationRequest HTMLStyleElement::insertedInto(ContainerNode* insertionPoint)
@@ -96,13 +98,15 @@ void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint)
void HTMLStyleElement::didNotifySubtreeInsertionsToDocument()
{
- StyleElement::processStyleSheet(document(), this);
+ if (StyleElement::processStyleSheet(document(), this) == StyleElement::ProcessingFatalError)
+ notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresource);
}
void HTMLStyleElement::childrenChanged(const ChildrenChange& change)
{
HTMLElement::childrenChanged(change);
- StyleElement::childrenChanged(this);
+ if (StyleElement::childrenChanged(this) == StyleElement::ProcessingFatalError)
+ notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresource);
}
const AtomicString& HTMLStyleElement::media() const
@@ -137,11 +141,11 @@ void HTMLStyleElement::dispatchPendingEvent(StyleEventSender* eventSender)
dispatchEvent(Event::create(m_loadedSheet ? EventTypeNames::load : EventTypeNames::error));
}
-void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred)
+void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources(LoadedSheetErrorStatus errorStatus)
{
if (m_firedLoad)
return;
- m_loadedSheet = !errorOccurred;
+ m_loadedSheet = (errorStatus == NoErrorLoadingSubresource);
styleLoadEventSender().dispatchEventSoon(this);
m_firedLoad = true;
}
« no previous file with comments | « Source/core/html/HTMLStyleElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698