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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.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, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3928 matching lines...) Expand 10 before | Expand all | Expand 10 after
3939 { 3939 {
3940 DCHECK(!eventFactories().contains(eventFactory.get())); 3940 DCHECK(!eventFactories().contains(eventFactory.get()));
3941 eventFactories().add(std::move(eventFactory)); 3941 eventFactories().add(std::move(eventFactory));
3942 } 3942 }
3943 3943
3944 Event* Document::createEvent(ExecutionContext* executionContext, const String& e ventType, ExceptionState& exceptionState) 3944 Event* Document::createEvent(ExecutionContext* executionContext, const String& e ventType, ExceptionState& exceptionState)
3945 { 3945 {
3946 Event* event = nullptr; 3946 Event* event = nullptr;
3947 for (const auto& factory : eventFactories()) { 3947 for (const auto& factory : eventFactories()) {
3948 event = factory->create(executionContext, eventType); 3948 event = factory->create(executionContext, eventType);
3949 if (event) 3949 if (event) {
3950 event->unsetInitializedFlag();
tkent 2016/05/02 00:19:27 This code implements what the specification says a
ramya.v 2016/05/02 05:31:44 Done.
3950 return event; 3951 return event;
3952 }
3951 } 3953 }
3952 exceptionState.throwDOMException(NotSupportedError, "The provided event type ('" + eventType + "') is invalid."); 3954 exceptionState.throwDOMException(NotSupportedError, "The provided event type ('" + eventType + "') is invalid.");
3953 return nullptr; 3955 return nullptr;
3954 } 3956 }
3955 3957
3956 void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType) 3958 void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType)
3957 { 3959 {
3958 if (ContextFeatures::mutationEventsEnabled(this)) 3960 if (ContextFeatures::mutationEventsEnabled(this))
3959 addListenerType(listenerType); 3961 addListenerType(listenerType);
3960 } 3962 }
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
5905 #ifndef NDEBUG 5907 #ifndef NDEBUG
5906 using namespace blink; 5908 using namespace blink;
5907 void showLiveDocumentInstances() 5909 void showLiveDocumentInstances()
5908 { 5910 {
5909 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5911 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5910 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5912 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5911 for (Document* document : set) 5913 for (Document* document : set)
5912 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5914 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
5913 } 5915 }
5914 #endif 5916 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698