Commit aea5ef90 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Simplify event dispatch in SVGSMILElement

(Re)use EventTarget::EnqueueEvent rather than (re)implementing something
pretty much identical.

Bug: 998526
Change-Id: I79a8d84141e37f485c9b74ee6dc2e4afacda080a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906150
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713864}
parent 902cdbdf
......@@ -1196,18 +1196,11 @@ void SVGSMILElement::ScheduleRepeatEvents() {
}
void SVGSMILElement::ScheduleEvent(const AtomicString& event_type) {
GetDocument()
.GetTaskRunner(TaskType::kDOMManipulation)
->PostTask(FROM_HERE, WTF::Bind(&SVGSMILElement::DispatchPendingEvent,
WrapPersistent(this), event_type));
}
void SVGSMILElement::DispatchPendingEvent(const AtomicString& event_type) {
DCHECK(event_type == event_type_names::kEndEvent ||
event_type == event_type_names::kBeginEvent ||
event_type == event_type_names::kRepeatEvent ||
event_type == "repeatn");
DispatchEvent(*Event::Create(event_type));
EnqueueEvent(*Event::Create(event_type), TaskType::kDOMManipulation);
}
bool SVGSMILElement::HasValidTarget() const {
......
......@@ -124,7 +124,6 @@ class CORE_EXPORT SVGSMILElement : public SVGElement, public SVGTests {
void ScheduleEvent(const AtomicString& event_type);
void ScheduleRepeatEvents();
void DispatchPendingEvent(const AtomicString& event_type);
virtual bool IsSVGDiscardElement() const { return false; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment