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

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

Issue 1150623003: Revamp asynchronous (load) event dispatching for SVG elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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
Index: Source/core/svg/SVGStyleElement.cpp
diff --git a/Source/core/svg/SVGStyleElement.cpp b/Source/core/svg/SVGStyleElement.cpp
index 1b91159b015ef84573b0d6e78645ed663e8b1752..b942eda10c84ada8af90448317045c1dd2237507 100644
--- a/Source/core/svg/SVGStyleElement.cpp
+++ b/Source/core/svg/SVGStyleElement.cpp
@@ -39,7 +39,6 @@ static SVGStyleEventSender& styleErrorEventSender()
inline SVGStyleElement::SVGStyleElement(Document& document, bool createdByParser)
: SVGElement(SVGNames::styleTag, document)
, StyleElement(&document, createdByParser)
- , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired)
{
}
@@ -121,7 +120,7 @@ void SVGStyleElement::finishParsingChildren()
StyleElement::ProcessingResult result = StyleElement::finishParsingChildren(this);
SVGElement::finishParsingChildren();
if (result == StyleElement::ProcessingFatalError)
- sendSVGErrorEventAsynchronously();
+ notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresource);
}
Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode* insertionPoint)
@@ -134,7 +133,7 @@ Node::InsertionNotificationRequest SVGStyleElement::insertedInto(ContainerNode*
void SVGStyleElement::didNotifySubtreeInsertionsToDocument()
{
if (StyleElement::processStyleSheet(document(), this) == StyleElement::ProcessingFatalError)
- sendSVGErrorEventAsynchronously();
+ notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresource);
}
void SVGStyleElement::removedFrom(ContainerNode* insertionPoint)
@@ -147,12 +146,13 @@ void SVGStyleElement::childrenChanged(const ChildrenChange& change)
{
SVGElement::childrenChanged(change);
if (StyleElement::childrenChanged(this) == StyleElement::ProcessingFatalError)
- sendSVGErrorEventAsynchronously();
+ notifyLoadedSheetAndAllCriticalSubresources(ErrorOccurredLoadingSubresource);
}
-void SVGStyleElement::sendSVGErrorEventAsynchronously()
+void SVGStyleElement::notifyLoadedSheetAndAllCriticalSubresources(LoadedSheetErrorStatus errorStatus)
{
- styleErrorEventSender().dispatchEventSoon(this);
+ if (errorStatus != NoErrorLoadingSubresource)
fs 2015/05/20 14:43:34 HTMLStyleElement actually dispatches 'load' events
+ styleErrorEventSender().dispatchEventSoon(this);
}
void SVGStyleElement::dispatchPendingEvent(SVGStyleEventSender* eventSender)

Powered by Google App Engine
This is Rietveld 408576698