Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 virtual Node* toNode(); | 110 virtual Node* toNode(); |
| 111 virtual const DOMWindow* toDOMWindow() const; | 111 virtual const DOMWindow* toDOMWindow() const; |
| 112 virtual const LocalDOMWindow* toLocalDOMWindow() const; | 112 virtual const LocalDOMWindow* toLocalDOMWindow() const; |
| 113 virtual LocalDOMWindow* toLocalDOMWindow(); | 113 virtual LocalDOMWindow* toLocalDOMWindow(); |
| 114 virtual MessagePort* toMessagePort(); | 114 virtual MessagePort* toMessagePort(); |
| 115 | 115 |
| 116 bool addEventListener(const AtomicString& eventType, EventListener*, bool us eCapture = false); | 116 bool addEventListener(const AtomicString& eventType, EventListener*, bool us eCapture = false); |
| 117 bool addEventListener(const AtomicString& eventType, EventListener*, const E ventListenerOptionsOrBoolean&); | 117 bool addEventListener(const AtomicString& eventType, EventListener*, const E ventListenerOptionsOrBoolean&); |
| 118 bool addEventListener(const AtomicString& eventType, EventListener*, EventLi stenerOptions&); | 118 bool addEventListener(const AtomicString& eventType, EventListener*, EventLi stenerOptions&); |
| 119 | 119 |
| 120 bool removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture = false); | 120 bool removeEventListener(const AtomicString& eventType, const EventListener* , bool useCapture = false); |
| 121 bool removeEventListener(const AtomicString& eventType, EventListener*, cons t EventListenerOptionsOrBoolean&); | 121 bool removeEventListener(const AtomicString& eventType, const EventListener* , const EventListenerOptionsOrBoolean&); |
| 122 bool removeEventListener(const AtomicString& eventType, EventListener*, Even tListenerOptions&); | 122 bool removeEventListener(const AtomicString& eventType, const EventListener* , EventListenerOptions&); |
| 123 virtual void removeAllEventListeners(); | 123 virtual void removeAllEventListeners(); |
| 124 | 124 |
| 125 DispatchEventResult dispatchEvent(Event*); | 125 DispatchEventResult dispatchEvent(Event*); |
| 126 | 126 |
| 127 // dispatchEventForBindings is intended to only be called from | 127 // dispatchEventForBindings is intended to only be called from |
| 128 // javascript originated calls. This method will validate and may adjust | 128 // javascript originated calls. This method will validate and may adjust |
| 129 // the Event object before dispatching. | 129 // the Event object before dispatching. |
| 130 bool dispatchEventForBindings(Event*, ExceptionState&); | 130 bool dispatchEventForBindings(Event*, ExceptionState&); |
| 131 virtual void uncaughtExceptionInEventHandler(); | 131 virtual void uncaughtExceptionInEventHandler(); |
| 132 | 132 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 145 static DispatchEventResult dispatchEventResult(const Event&); | 145 static DispatchEventResult dispatchEventResult(const Event&); |
| 146 | 146 |
| 147 DEFINE_INLINE_VIRTUAL_TRACE() { } | 147 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 148 | 148 |
| 149 virtual bool keepEventInNode(Event*) { return false; } | 149 virtual bool keepEventInNode(Event*) { return false; } |
| 150 | 150 |
| 151 protected: | 151 protected: |
| 152 EventTarget(); | 152 EventTarget(); |
| 153 | 153 |
| 154 virtual bool addEventListenerInternal(const AtomicString& eventType, EventLi stener*, const EventListenerOptions&); | 154 virtual bool addEventListenerInternal(const AtomicString& eventType, EventLi stener*, const EventListenerOptions&); |
| 155 virtual bool removeEventListenerInternal(const AtomicString& eventType, Even tListener*, const EventListenerOptions&); | 155 virtual bool removeEventListenerInternal(const AtomicString& eventType, cons t EventListener*, const EventListenerOptions&); |
| 156 | |
| 157 // Called when an event listener has succesfully added. | |
|
ortuno
2016/05/03 20:59:56
nit: s/has succesfully added/has been successfully
dtapuska
2016/05/03 21:07:31
oh boy clearly I didn't read what I typed.
| |
| 158 virtual void addedEventListener(const AtomicString& eventType, RegisteredEve ntListener&); | |
| 159 | |
| 160 // Called when an event listener is removed. The original registration param eters with this | |
|
ortuno
2016/05/03 20:59:56
nit: s/parameters with/parameters of/
dtapuska
2016/05/03 21:07:31
ditto.
| |
| 161 // event listener are available to be queried. | |
| 162 virtual void removedEventListener(const AtomicString& eventType, const Regis teredEventListener&); | |
| 163 | |
| 156 virtual DispatchEventResult dispatchEventInternal(Event*); | 164 virtual DispatchEventResult dispatchEventInternal(Event*); |
| 157 | 165 |
| 158 // Subclasses should likely not override these themselves; instead, they sho uld subclass EventTargetWithInlineData. | 166 // Subclasses should likely not override these themselves; instead, they sho uld subclass EventTargetWithInlineData. |
| 159 virtual EventTargetData* eventTargetData() = 0; | 167 virtual EventTargetData* eventTargetData() = 0; |
| 160 virtual EventTargetData& ensureEventTargetData() = 0; | 168 virtual EventTargetData& ensureEventTargetData() = 0; |
| 161 | 169 |
| 162 private: | 170 private: |
| 163 LocalDOMWindow* executingWindow(); | 171 LocalDOMWindow* executingWindow(); |
| 164 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); | 172 void fireEventListeners(Event*, EventTargetData*, EventListenerVector&); |
| 165 void countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVect or*, EventListenerVector*); | 173 void countLegacyEvents(const AtomicString& legacyTypeName, EventListenerVect or*, EventListenerVector*); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 { | 251 { |
| 244 EventTargetData* d = eventTargetData(); | 252 EventTargetData* d = eventTargetData(); |
| 245 if (!d) | 253 if (!d) |
| 246 return false; | 254 return false; |
| 247 return d->eventListenerMap.containsCapturing(eventType); | 255 return d->eventListenerMap.containsCapturing(eventType); |
| 248 } | 256 } |
| 249 | 257 |
| 250 } // namespace blink | 258 } // namespace blink |
| 251 | 259 |
| 252 #endif // EventTarget_h | 260 #endif // EventTarget_h |
| OLD | NEW |