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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 254133002: Remove support for Document.createEvent() without argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add layout test Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3838 matching lines...) Expand 10 before | Expand all | Expand 10 after
3849 PassRefPtrWillBeRawPtr<Event> Document::createEvent(const String& eventType, Exc eptionState& exceptionState) 3849 PassRefPtrWillBeRawPtr<Event> Document::createEvent(const String& eventType, Exc eptionState& exceptionState)
3850 { 3850 {
3851 RefPtrWillBeRawPtr<Event> event = EventFactory::create(eventType); 3851 RefPtrWillBeRawPtr<Event> event = EventFactory::create(eventType);
3852 if (event) 3852 if (event)
3853 return event.release(); 3853 return event.release();
3854 3854
3855 exceptionState.throwDOMException(NotSupportedError, "The provided event type ('" + eventType + "') is invalid."); 3855 exceptionState.throwDOMException(NotSupportedError, "The provided event type ('" + eventType + "') is invalid.");
3856 return nullptr; 3856 return nullptr;
3857 } 3857 }
3858 3858
3859 PassRefPtrWillBeRawPtr<Event> Document::createEvent(ExceptionState& exceptionSta te)
3860 {
3861 if (!isSVGDocument()) {
3862 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, 0 ));
3863 return nullptr;
3864 }
3865
3866 UseCounter::count(this, UseCounter::DocumentCreateEventOptionalArgument);
3867 // Legacy SVGDocument behavior.
3868 return createEvent("undefined", exceptionState);
3869 }
3870
3871 void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType) 3859 void Document::addMutationEventListenerTypeIfEnabled(ListenerType listenerType)
3872 { 3860 {
3873 if (ContextFeatures::mutationEventsEnabled(this)) 3861 if (ContextFeatures::mutationEventsEnabled(this))
3874 addListenerType(listenerType); 3862 addListenerType(listenerType);
3875 } 3863 }
3876 3864
3877 void Document::addListenerTypeIfNeeded(const AtomicString& eventType) 3865 void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
3878 { 3866 {
3879 if (eventType == EventTypeNames::DOMSubtreeModified) { 3867 if (eventType == EventTypeNames::DOMSubtreeModified) {
3880 UseCounter::count(*this, UseCounter::DOMSubtreeModifiedEvent); 3868 UseCounter::count(*this, UseCounter::DOMSubtreeModifiedEvent);
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 visitor->trace(m_mediaQueryMatcher); 5661 visitor->trace(m_mediaQueryMatcher);
5674 visitor->trace(m_visibilityObservers); 5662 visitor->trace(m_visibilityObservers);
5675 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5663 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5676 Supplementable<Document>::trace(visitor); 5664 Supplementable<Document>::trace(visitor);
5677 TreeScope::trace(visitor); 5665 TreeScope::trace(visitor);
5678 ContainerNode::trace(visitor); 5666 ContainerNode::trace(visitor);
5679 ExecutionContext::trace(visitor); 5667 ExecutionContext::trace(visitor);
5680 } 5668 }
5681 5669
5682 } // namespace WebCore 5670 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698