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

Unified Diff: third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp

Issue 2478603003: Remove EventSender in HTMLDetailsElement (Closed)
Patch Set: cancel by move-in Created 4 years, 1 month 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/html/HTMLDetailsElement.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/html/HTMLDetailsElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp b/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
index 52d2b418ab87a0a36e8c1a07e201a81dba309e50..5a34cbf08bc6c35a3bda87f430fd84fe50aa0e87 100644
--- a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
@@ -25,10 +25,10 @@
#include "core/CSSValueKeywords.h"
#include "core/HTMLNames.h"
#include "core/dom/ElementTraversal.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/Text.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
-#include "core/events/EventSender.h"
#include "core/frame/UseCounter.h"
#include "core/html/HTMLContentElement.h"
#include "core/html/HTMLDivElement.h"
@@ -67,12 +67,6 @@ class FirstSummarySelectFilter final : public HTMLContentSelectFilter {
FirstSummarySelectFilter() {}
};
-static DetailsEventSender& detailsToggleEventSender() {
- DEFINE_STATIC_LOCAL(DetailsEventSender, sharedToggleEventSender,
- (DetailsEventSender::create(EventTypeNames::toggle)));
- return sharedToggleEventSender;
-}
-
HTMLDetailsElement* HTMLDetailsElement::create(Document& document) {
HTMLDetailsElement* details = new HTMLDetailsElement(document);
details->ensureUserAgentShadowRoot();
@@ -86,8 +80,7 @@ HTMLDetailsElement::HTMLDetailsElement(Document& document)
HTMLDetailsElement::~HTMLDetailsElement() {}
-void HTMLDetailsElement::dispatchPendingEvent(DetailsEventSender* eventSender) {
- DCHECK_EQ(eventSender, &detailsToggleEventSender());
+void HTMLDetailsElement::dispatchPendingEvent() {
dispatchEvent(Event::create(EventTypeNames::toggle));
}
@@ -135,8 +128,12 @@ void HTMLDetailsElement::parseAttribute(const QualifiedName& name,
return;
// Dispatch toggle event asynchronously.
- detailsToggleEventSender().cancelEvent(this);
- detailsToggleEventSender().dispatchEventSoon(this);
+ m_pendingEvent =
hiroshige 2016/11/07 09:24:55 Here previous event is canceled (because |m_pendin
haraken 2016/11/07 09:51:01 Hmm, we need to keep holding m_pendingEvent in ord
+ TaskRunnerHelper::get(TaskType::DOMManipulation, &document())
+ ->postCancellableTask(
+ BLINK_FROM_HERE,
+ WTF::bind(&HTMLDetailsElement::dispatchPendingEvent,
+ wrapPersistent(this)));
Element* content = ensureUserAgentShadowRoot().getElementById(
ShadowElementNames::detailsContent());
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLDetailsElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698