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

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

Issue 2487433002: Revert of Remove EventSender from HTMLStyleElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/HTMLStyleElement.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/HTMLStyleElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp b/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp
index d3b1f7f60e7d91a49bc874ca05ee8f9b2a3de1bc..a62e1e9c417e23705102dd17553a32bf94a60870 100644
--- a/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp
@@ -27,13 +27,19 @@
#include "core/css/MediaList.h"
#include "core/dom/Document.h"
#include "core/dom/StyleEngine.h"
-#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
+#include "core/events/EventSender.h"
namespace blink {
using namespace HTMLNames;
+
+static StyleEventSender& styleLoadEventSender() {
+ DEFINE_STATIC_LOCAL(StyleEventSender, sharedLoadEventSender,
+ (StyleEventSender::create(EventTypeNames::load)));
+ return sharedLoadEventSender;
+}
inline HTMLStyleElement::HTMLStyleElement(Document& document,
bool createdByParser)
@@ -107,8 +113,12 @@
return getAttribute(typeAttr);
}
-void HTMLStyleElement::dispatchPendingEvent(
- std::unique_ptr<IncrementLoadEventDelayCount>) {
+void HTMLStyleElement::dispatchPendingLoadEvents() {
+ styleLoadEventSender().dispatchPendingEvents();
+}
+
+void HTMLStyleElement::dispatchPendingEvent(StyleEventSender* eventSender) {
+ DCHECK_EQ(eventSender, &styleLoadEventSender());
dispatchEvent(Event::create(m_loadedSheet ? EventTypeNames::load
: EventTypeNames::error));
}
@@ -119,12 +129,7 @@
if (m_firedLoad && isLoadEvent)
return;
m_loadedSheet = isLoadEvent;
- TaskRunnerHelper::get(TaskType::DOMManipulation, &document())
- ->postTask(
- BLINK_FROM_HERE,
- WTF::bind(&HTMLStyleElement::dispatchPendingEvent,
- wrapPersistent(this),
- passed(IncrementLoadEventDelayCount::create(document()))));
+ styleLoadEventSender().dispatchEventSoon(this);
m_firedLoad = true;
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLStyleElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698