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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 1929843002: Events should have an initialized flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified assert Created 4 years, 8 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: third_party/WebKit/Source/core/events/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index 1e283f2351d51fd792e8f6fc3dcf992b9350ae6b..4072921002a287b8fa727b0ec2a4b04b849c0509 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -256,7 +256,7 @@ bool EventTarget::clearAttributeEventListener(const AtomicString& eventType)
bool EventTarget::dispatchEventForBindings(Event* event, ExceptionState& exceptionState)
{
- if (event->type().isEmpty()) {
+ if (!event->initialized()) {
exceptionState.throwDOMException(InvalidStateError, "The event provided is uninitialized.");
return false;
}
@@ -360,7 +360,7 @@ void EventTarget::countLegacyEvents(const AtomicString& legacyTypeName, EventLis
DispatchEventResult EventTarget::fireEventListeners(Event* event)
{
ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
- ASSERT(event && !event->type().isEmpty());
+ ASSERT(event && event->initialized());
tkent 2016/05/02 00:19:27 nit: Split this into two. DCHECK(event); D
ramya.v 2016/05/02 05:31:44 Done.
EventTargetData* d = eventTargetData();
if (!d)

Powered by Google App Engine
This is Rietveld 408576698