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

Unified Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 2095253002: Remove EventSender from SVGUseElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 2 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 | « third_party/WebKit/Source/core/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/SVGUseElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
index 2d4412822dfc3350b8b0b86464fc378ed4de0558..e20fdda2e96623add4c6d59617f1fe6d401d31f8 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -30,6 +30,7 @@
#include "core/dom/Document.h"
#include "core/dom/ElementTraversal.h"
#include "core/dom/StyleChangeReason.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
@@ -46,12 +47,6 @@
namespace blink {
-static SVGUseEventSender& svgUseLoadEventSender() {
- DEFINE_STATIC_LOCAL(SVGUseEventSender, sharedLoadEventSender,
- (SVGUseEventSender::create(EventTypeNames::load)));
- return sharedLoadEventSender;
-}
-
inline SVGUseElement::SVGUseElement(Document& document)
: SVGGraphicsElement(SVGNames::useTag, document),
SVGURIReference(this),
@@ -689,8 +684,7 @@ FloatRect SVGUseElement::getBBox() {
return bbox;
}
-void SVGUseElement::dispatchPendingEvent(SVGUseEventSender* eventSender) {
- ASSERT_UNUSED(eventSender, eventSender == &svgUseLoadEventSender());
+void SVGUseElement::dispatchPendingEvent() {
ASSERT(isStructurallyExternal() && m_haveFiredLoadEvent);
dispatchEvent(Event::create(EventTypeNames::load));
}
@@ -710,7 +704,10 @@ void SVGUseElement::notifyFinished(Resource* resource) {
return;
ASSERT(!m_haveFiredLoadEvent);
m_haveFiredLoadEvent = true;
- svgUseLoadEventSender().dispatchEventSoon(this);
+ TaskRunnerHelper::get(TaskType::DOMManipulation, &document())
+ ->postTask(BLINK_FROM_HERE,
+ WTF::bind(&SVGUseElement::dispatchPendingEvent,
+ wrapPersistent(this)));
}
}
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698