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

Unified Diff: Source/core/svg/SVGStyleElement.cpp

Issue 1049513003: Add error dispatch events to SVGStyleElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added more tests 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
« Source/core/svg/SVGElement.cpp ('K') | « Source/core/svg/SVGStyleElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGStyleElement.cpp
diff --git a/Source/core/svg/SVGStyleElement.cpp b/Source/core/svg/SVGStyleElement.cpp
index b4d0e79feef421c9f28cf4e95de8bf1778169d55..9437fa768cbecd5bbc8619611dbbc4368e9a372a 100644
--- a/Source/core/svg/SVGStyleElement.cpp
+++ b/Source/core/svg/SVGStyleElement.cpp
@@ -33,6 +33,7 @@ inline SVGStyleElement::SVGStyleElement(Document& document, bool createdByParser
: SVGElement(SVGNames::styleTag, document)
, StyleElement(&document, createdByParser)
, m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired)
+ , m_svgErrorEventTimer(this, &SVGElement::svgErrorEventTimerFired)
{
}
@@ -109,8 +110,10 @@ void SVGStyleElement::parseAttribute(const QualifiedName& name, const AtomicStri
void SVGStyleElement::finishParsingChildren()
{
- StyleElement::finishParsingChildren(this);
+ StyleElement::ProcessingResult result = StyleElement::finishParsingChildren(this);
SVGElement::finishParsingChildren();
+ if (result == StyleElement::ProcessingFatalError)
+ SVGElement::sendSVGErrorEventIfPossibleAsynchronously();
}
Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode* insertionPoint)
@@ -122,7 +125,8 @@ Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode*
void SVGStyleElement::didNotifySubtreeInsertionsToDocument()
{
- StyleElement::processStyleSheet(document(), this);
+ if (StyleElement::processStyleSheet(document(), this) == StyleElement::ProcessingFatalError)
+ SVGElement::sendSVGErrorEventIfPossibleAsynchronously();
}
void SVGStyleElement::removedFrom(ContainerNode* insertionPoint)
@@ -134,7 +138,8 @@ void SVGStyleElement::removedFrom(ContainerNode* insertionPoint)
void SVGStyleElement::childrenChanged(const ChildrenChange& change)
{
SVGElement::childrenChanged(change);
- StyleElement::childrenChanged(this);
+ if (StyleElement::childrenChanged(this) == StyleElement::ProcessingFatalError)
+ SVGElement::sendSVGErrorEventIfPossibleAsynchronously();
}
DEFINE_TRACE(SVGStyleElement)
« Source/core/svg/SVGElement.cpp ('K') | « Source/core/svg/SVGStyleElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698