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

Side by Side Diff: Source/core/events/EventTarget.h

Issue 331323012: Revert of Throw TypeError when addEventListener or removeEventListener are called (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/bindings/tests/results/V8TestObject.cpp ('k') | Source/core/events/EventTarget.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 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void deref() { derefEventTarget(); } 79 void deref() { derefEventTarget(); }
80 #endif 80 #endif
81 81
82 virtual const AtomicString& interfaceName() const = 0; 82 virtual const AtomicString& interfaceName() const = 0;
83 virtual ExecutionContext* executionContext() const = 0; 83 virtual ExecutionContext* executionContext() const = 0;
84 84
85 virtual Node* toNode(); 85 virtual Node* toNode();
86 virtual LocalDOMWindow* toDOMWindow(); 86 virtual LocalDOMWindow* toDOMWindow();
87 virtual MessagePort* toMessagePort(); 87 virtual MessagePort* toMessagePort();
88 88
89 // FIXME: default values should be specified in IDL, not C++ 89 // FIXME: first 2 args to addEventListener and removeEventListener should
90 // http://crbug.com/258153 90 // be required (per spec), but throwing TypeError breaks legacy content.
91 // http://crbug.com/353484
92 bool addEventListener() { return false; }
93 bool addEventListener(const AtomicString& eventType) { return false; }
91 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture = false); 94 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even tListener>, bool useCapture = false);
95 bool removeEventListener() { return false; }
96 bool removeEventListener(const AtomicString& eventType) { return false; }
92 virtual bool removeEventListener(const AtomicString& eventType, EventListene r*, bool useCapture = false); 97 virtual bool removeEventListener(const AtomicString& eventType, EventListene r*, bool useCapture = false);
93 virtual void removeAllEventListeners(); 98 virtual void removeAllEventListeners();
94 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>); 99 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>);
95 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>, ExceptionState&); // DOM A PI 100 bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>, ExceptionState&); // DOM A PI
96 virtual void uncaughtExceptionInEventHandler(); 101 virtual void uncaughtExceptionInEventHandler();
97 102
98 // Used for legacy "onEvent" attribute APIs. 103 // Used for legacy "onEvent" attribute APIs.
99 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<Eve ntListener>); 104 bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<Eve ntListener>);
100 EventListener* getAttributeEventListener(const AtomicString& eventType); 105 EventListener* getAttributeEventListener(const AtomicString& eventType);
101 106
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro 236 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro
232 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_ TARGET_REFCOUNTING(baseClass) 237 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_ TARGET_REFCOUNTING(baseClass)
233 #endif 238 #endif
234 239
235 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou nted. 240 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou nted.
236 // A ref-counted class that uses a different method of refcounting should use DE FINE_EVENT_TARGET_REFCOUNTING directly. 241 // A ref-counted class that uses a different method of refcounting should use DE FINE_EVENT_TARGET_REFCOUNTING directly.
237 // Both of these macros are meant to be placed just before the "public:" section of the class declaration. 242 // Both of these macros are meant to be placed just before the "public:" section of the class declaration.
238 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING(RefCo untedWillBeRefCountedGarbageCollected<className>) 243 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING(RefCo untedWillBeRefCountedGarbageCollected<className>)
239 244
240 #endif // EventTarget_h 245 #endif // EventTarget_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/core/events/EventTarget.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698