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

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: Updated as per review comments 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
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.cpp ('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/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..230c6756ff1dd0844ccd0969d4815389b1012a73 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->wasInitialized()) {
exceptionState.throwDOMException(InvalidStateError, "The event provided is uninitialized.");
return false;
}
@@ -360,7 +360,8 @@ void EventTarget::countLegacyEvents(const AtomicString& legacyTypeName, EventLis
DispatchEventResult EventTarget::fireEventListeners(Event* event)
{
ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
- ASSERT(event && !event->type().isEmpty());
+ DCHECK(event);
+ DCHECK(event->wasInitialized());
EventTargetData* d = eventTargetData();
if (!d)
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698