<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181216] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181216">181216</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2015-03-07 17:37:26 -0800 (Sat, 07 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unindent EventTarget, EventListener, JSEventLister.h files
https://bugs.webkit.org/show_bug.cgi?id=142440
Reviewed by Alexey Proskuryakov.
* bindings/js/JSEventListener.h:
* dom/EventListener.h:
* dom/EventTarget.h:
Change indentation to match coding style rules.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenerh">trunk/Source/WebCore/bindings/js/JSEventListener.h</a></li>
<li><a href="#trunkSourceWebCoredomEventListenerh">trunk/Source/WebCore/dom/EventListener.h</a></li>
<li><a href="#trunkSourceWebCoredomEventTargeth">trunk/Source/WebCore/dom/EventTarget.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181215 => 181216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-08 00:23:03 UTC (rev 181215)
+++ trunk/Source/WebCore/ChangeLog        2015-03-08 01:37:26 UTC (rev 181216)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-03-07 Darin Adler <darin@apple.com>
+
+ Unindent EventTarget, EventListener, JSEventLister.h files
+ https://bugs.webkit.org/show_bug.cgi?id=142440
+
+ Reviewed by Alexey Proskuryakov.
+
+ * bindings/js/JSEventListener.h:
+ * dom/EventListener.h:
+ * dom/EventTarget.h:
+ Change indentation to match coding style rules.
+
</ins><span class="cx"> 2015-03-07 Geoffrey Garen <ggaren@apple.com>
</span><span class="cx">
</span><span class="cx"> Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.h (181215 => 181216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.h        2015-03-08 00:23:03 UTC (rev 181215)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.h        2015-03-08 01:37:26 UTC (rev 181216)
</span><span class="lines">@@ -29,100 +29,100 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class EventTarget;
- class HTMLElement;
- class JSDOMGlobalObject;
</del><ins>+class EventTarget;
+class HTMLElement;
+class JSDOMGlobalObject;
</ins><span class="cx">
</span><del>- class JSEventListener : public EventListener {
- public:
- static Ref<JSEventListener> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld& world)
- {
- return adoptRef(*new JSEventListener(listener, wrapper, isAttribute, world));
- }
</del><ins>+class JSEventListener : public EventListener {
+public:
+ static Ref<JSEventListener> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld& world)
+ {
+ return adoptRef(*new JSEventListener(listener, wrapper, isAttribute, world));
+ }
</ins><span class="cx">
</span><del>- static const JSEventListener* cast(const EventListener* listener)
- {
- return listener->type() == JSEventListenerType
- ? static_cast<const JSEventListener*>(listener)
- : 0;
- }
</del><ins>+ static const JSEventListener* cast(const EventListener* listener)
+ {
+ return listener->type() == JSEventListenerType
+ ? static_cast<const JSEventListener*>(listener)
+ : 0;
+ }
</ins><span class="cx">
</span><del>- virtual ~JSEventListener();
</del><ins>+ virtual ~JSEventListener();
</ins><span class="cx">
</span><del>- virtual bool operator==(const EventListener& other) override;
</del><ins>+ virtual bool operator==(const EventListener& other) override;
</ins><span class="cx">
</span><del>- // Returns true if this event listener was created for an event handler attribute, like "onload" or "onclick".
- bool isAttribute() const { return m_isAttribute; }
</del><ins>+ // Returns true if this event listener was created for an event handler attribute, like "onload" or "onclick".
+ bool isAttribute() const { return m_isAttribute; }
</ins><span class="cx">
</span><del>- JSC::JSObject* jsFunction(ScriptExecutionContext*) const;
- DOMWrapperWorld& isolatedWorld() const { return *m_isolatedWorld; }
</del><ins>+ JSC::JSObject* jsFunction(ScriptExecutionContext*) const;
+ DOMWrapperWorld& isolatedWorld() const { return *m_isolatedWorld; }
</ins><span class="cx">
</span><del>- JSC::JSObject* wrapper() const { return m_wrapper.get(); }
- void setWrapper(JSC::VM&, JSC::JSObject* wrapper) const { m_wrapper = JSC::Weak<JSC::JSObject>(wrapper); }
</del><ins>+ JSC::JSObject* wrapper() const { return m_wrapper.get(); }
+ void setWrapper(JSC::VM&, JSC::JSObject* wrapper) const { m_wrapper = JSC::Weak<JSC::JSObject>(wrapper); }
</ins><span class="cx">
</span><del>- private:
- virtual JSC::JSObject* initializeJSFunction(ScriptExecutionContext*) const;
- virtual void visitJSFunction(JSC::SlotVisitor&) override;
- virtual bool virtualisAttribute() const override;
</del><ins>+private:
+ virtual JSC::JSObject* initializeJSFunction(ScriptExecutionContext*) const;
+ virtual void visitJSFunction(JSC::SlotVisitor&) override;
+ virtual bool virtualisAttribute() const override;
</ins><span class="cx">
</span><del>- protected:
- JSEventListener(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld&);
- virtual void handleEvent(ScriptExecutionContext*, Event*) override;
</del><ins>+protected:
+ JSEventListener(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld&);
+ virtual void handleEvent(ScriptExecutionContext*, Event*) override;
</ins><span class="cx">
</span><del>- private:
- mutable JSC::Weak<JSC::JSObject> m_jsFunction;
- mutable JSC::Weak<JSC::JSObject> m_wrapper;
</del><ins>+private:
+ mutable JSC::Weak<JSC::JSObject> m_jsFunction;
+ mutable JSC::Weak<JSC::JSObject> m_wrapper;
</ins><span class="cx">
</span><del>- bool m_isAttribute;
- RefPtr<DOMWrapperWorld> m_isolatedWorld;
- };
</del><ins>+ bool m_isAttribute;
+ RefPtr<DOMWrapperWorld> m_isolatedWorld;
+};
</ins><span class="cx">
</span><del>- // For "onxxx" attributes that automatically set up JavaScript event listeners.
- JSC::JSValue eventHandlerAttribute(EventTarget&, const AtomicString& eventType);
- void setEventHandlerAttribute(JSC::ExecState&, JSC::JSObject&, EventTarget&, const AtomicString& eventType, JSC::JSValue);
</del><ins>+// For "onxxx" attributes that automatically set up JavaScript event listeners.
+JSC::JSValue eventHandlerAttribute(EventTarget&, const AtomicString& eventType);
+void setEventHandlerAttribute(JSC::ExecState&, JSC::JSObject&, EventTarget&, const AtomicString& eventType, JSC::JSValue);
</ins><span class="cx">
</span><del>- // Like the functions above, but for attributes that forward event handlers to the window object rather than setting them on the target.
- JSC::JSValue windowForwardedEventHandlerAttribute(HTMLElement&, const AtomicString& eventType);
- void setWindowForwardedEventHandlerAttribute(JSC::ExecState&, JSC::JSObject&, HTMLElement&, const AtomicString& eventType, JSC::JSValue);
</del><ins>+// Like the functions above, but for attributes that forward event handlers to the window object rather than setting them on the target.
+JSC::JSValue windowForwardedEventHandlerAttribute(HTMLElement&, const AtomicString& eventType);
+void setWindowForwardedEventHandlerAttribute(JSC::ExecState&, JSC::JSObject&, HTMLElement&, const AtomicString& eventType, JSC::JSValue);
</ins><span class="cx">
</span><del>- Ref<JSEventListener> createJSEventListenerForAdd(JSC::ExecState&, JSC::JSObject& listener, JSC::JSObject& wrapper);
- Ref<JSEventListener> createJSEventListenerForRemove(JSC::ExecState&, JSC::JSObject& listener, JSC::JSObject& wrapper);
</del><ins>+Ref<JSEventListener> createJSEventListenerForAdd(JSC::ExecState&, JSC::JSObject& listener, JSC::JSObject& wrapper);
+Ref<JSEventListener> createJSEventListenerForRemove(JSC::ExecState&, JSC::JSObject& listener, JSC::JSObject& wrapper);
</ins><span class="cx">
</span><del>- inline JSC::JSObject* JSEventListener::jsFunction(ScriptExecutionContext* scriptExecutionContext) const
- {
- // initializeJSFunction can trigger code that deletes this event listener
- // before we're done. It should always return 0 in this case.
- Ref<JSEventListener> protect(const_cast<JSEventListener&>(*this));
- JSC::Strong<JSC::JSObject> wrapper(m_isolatedWorld->vm(), m_wrapper.get());
</del><ins>+inline JSC::JSObject* JSEventListener::jsFunction(ScriptExecutionContext* scriptExecutionContext) const
+{
+ // initializeJSFunction can trigger code that deletes this event listener
+ // before we're done. It should always return 0 in this case.
+ Ref<JSEventListener> protect(const_cast<JSEventListener&>(*this));
+ JSC::Strong<JSC::JSObject> wrapper(m_isolatedWorld->vm(), m_wrapper.get());
</ins><span class="cx">
</span><del>- if (!m_jsFunction) {
- JSC::JSObject* function = initializeJSFunction(scriptExecutionContext);
- JSC::JSObject* wrapper = m_wrapper.get();
- if (wrapper)
- JSC::Heap::heap(wrapper)->writeBarrier(wrapper, function);
- m_jsFunction = JSC::Weak<JSC::JSObject>(function);
- }
</del><ins>+ if (!m_jsFunction) {
+ JSC::JSObject* function = initializeJSFunction(scriptExecutionContext);
+ JSC::JSObject* wrapper = m_wrapper.get();
+ if (wrapper)
+ JSC::Heap::heap(wrapper)->writeBarrier(wrapper, function);
+ m_jsFunction = JSC::Weak<JSC::JSObject>(function);
+ }
</ins><span class="cx">
</span><del>- // Verify that we have a valid wrapper protecting our function from
- // garbage collection. That is except for when we're not in the normal
- // world and can have zombie m_jsFunctions.
- ASSERT(!m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction);
</del><ins>+ // Verify that we have a valid wrapper protecting our function from
+ // garbage collection. That is except for when we're not in the normal
+ // world and can have zombie m_jsFunctions.
+ ASSERT(!m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction);
</ins><span class="cx">
</span><del>- // If m_wrapper is 0, then m_jsFunction is zombied, and should never be accessed.
- if (!m_wrapper)
- return 0;
</del><ins>+ // If m_wrapper is 0, then m_jsFunction is zombied, and should never be accessed.
+ if (!m_wrapper)
+ return 0;
</ins><span class="cx">
</span><del>- // Try to verify that m_jsFunction wasn't recycled. (Not exact, since an
- // event listener can be almost anything, but this makes test-writing easier).
- ASSERT(!m_jsFunction || static_cast<JSC::JSCell*>(m_jsFunction.get())->isObject());
</del><ins>+ // Try to verify that m_jsFunction wasn't recycled. (Not exact, since an
+ // event listener can be almost anything, but this makes test-writing easier).
+ ASSERT(!m_jsFunction || static_cast<JSC::JSCell*>(m_jsFunction.get())->isObject());
</ins><span class="cx">
</span><del>- return m_jsFunction.get();
- }
</del><ins>+ return m_jsFunction.get();
+}
</ins><span class="cx">
</span><del>- inline Ref<JSEventListener> createJSEventListenerForRemove(JSC::ExecState& state, JSC::JSObject& listener, JSC::JSObject& wrapper)
- {
- return createJSEventListenerForAdd(state, listener, wrapper);
- }
</del><ins>+inline Ref<JSEventListener> createJSEventListenerForRemove(JSC::ExecState& state, JSC::JSObject& listener, JSC::JSObject& wrapper)
+{
+ return createJSEventListenerForAdd(state, listener, wrapper);
+}
</ins><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventListener.h (181215 => 181216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventListener.h        2015-03-08 00:23:03 UTC (rev 181215)
+++ trunk/Source/WebCore/dom/EventListener.h        2015-03-08 01:37:26 UTC (rev 181216)
</span><span class="lines">@@ -24,50 +24,50 @@
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="cx"> namespace JSC {
</span><del>- class JSObject;
- class SlotVisitor;
</del><ins>+class JSObject;
+class SlotVisitor;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class ScriptExecutionContext;
- class Event;
</del><ins>+class ScriptExecutionContext;
+class Event;
</ins><span class="cx">
</span><del>- class EventListener : public RefCounted<EventListener> {
- public:
- enum Type {
- JSEventListenerType,
- ImageEventListenerType,
- ObjCEventListenerType,
- CPPEventListenerType,
- ConditionEventListenerType,
- GObjectEventListenerType,
- NativeEventListenerType,
- SVGTRefTargetEventListenerType,
- MediaControlsAppleEventListenerType
- };
</del><ins>+class EventListener : public RefCounted<EventListener> {
+public:
+ enum Type {
+ JSEventListenerType,
+ ImageEventListenerType,
+ ObjCEventListenerType,
+ CPPEventListenerType,
+ ConditionEventListenerType,
+ GObjectEventListenerType,
+ NativeEventListenerType,
+ SVGTRefTargetEventListenerType,
+ MediaControlsAppleEventListenerType
+ };
</ins><span class="cx">
</span><del>- virtual ~EventListener() { }
- virtual bool operator==(const EventListener&) = 0;
- virtual void handleEvent(ScriptExecutionContext*, Event*) = 0;
- virtual bool wasCreatedFromMarkup() const { return false; }
</del><ins>+ virtual ~EventListener() { }
+ virtual bool operator==(const EventListener&) = 0;
+ virtual void handleEvent(ScriptExecutionContext*, Event*) = 0;
+ virtual bool wasCreatedFromMarkup() const { return false; }
</ins><span class="cx">
</span><del>- virtual void visitJSFunction(JSC::SlotVisitor&) { }
</del><ins>+ virtual void visitJSFunction(JSC::SlotVisitor&) { }
</ins><span class="cx">
</span><del>- bool isAttribute() const { return virtualisAttribute(); }
- Type type() const { return m_type; }
</del><ins>+ bool isAttribute() const { return virtualisAttribute(); }
+ Type type() const { return m_type; }
</ins><span class="cx">
</span><del>- protected:
- explicit EventListener(Type type)
- : m_type(type)
- {
- }
</del><ins>+protected:
+ explicit EventListener(Type type)
+ : m_type(type)
+ {
+ }
</ins><span class="cx">
</span><del>- private:
- virtual bool virtualisAttribute() const { return false; }
-
- Type m_type;
- };
</del><ins>+private:
+ virtual bool virtualisAttribute() const { return false; }
+
+ Type m_type;
+};
</ins><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventTarget.h (181215 => 181216)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventTarget.h        2015-03-08 00:23:03 UTC (rev 181215)
+++ trunk/Source/WebCore/dom/EventTarget.h        2015-03-08 01:37:26 UTC (rev 181216)
</span><span class="lines">@@ -25,8 +25,7 @@
</span><span class="cx"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
</span><span class="cx"> * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
</span><span class="cx"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><del>- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
</del><ins>+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #ifndef EventTarget_h
</span><span class="lines">@@ -44,168 +43,168 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><del>-
- class AudioNode;
- class AudioContext;
- class AudioTrackList;
- class DedicatedWorkerGlobalScope;
- class DOMApplicationCache;
- class DOMWindow;
- class Event;
- class EventListener;
- class EventSource;
- class FileReader;
- class FileWriter;
- class IDBDatabase;
- class IDBRequest;
- class IDBTransaction;
- class ScriptProcessorNode;
- class MediaController;
- class MediaStream;
- class MessagePort;
- class Node;
- class Notification;
- class ScriptExecutionContext;
- class TextTrack;
- class TextTrackCue;
- class VideoTrackList;
- class WebSocket;
- class WebKitNamedFlow;
- class Worker;
- class XMLHttpRequest;
- class XMLHttpRequestUpload;
</del><span class="cx">
</span><del>- typedef int ExceptionCode;
</del><ins>+class AudioNode;
+class AudioContext;
+class AudioTrackList;
+class DedicatedWorkerGlobalScope;
+class DOMApplicationCache;
+class DOMWindow;
+class Event;
+class EventListener;
+class EventSource;
+class FileReader;
+class FileWriter;
+class IDBDatabase;
+class IDBRequest;
+class IDBTransaction;
+class ScriptProcessorNode;
+class MediaController;
+class MediaStream;
+class MessagePort;
+class Node;
+class Notification;
+class ScriptExecutionContext;
+class TextTrack;
+class TextTrackCue;
+class VideoTrackList;
+class WebSocket;
+class WebKitNamedFlow;
+class Worker;
+class XMLHttpRequest;
+class XMLHttpRequestUpload;
</ins><span class="cx">
</span><del>- struct FiringEventIterator {
- FiringEventIterator(const AtomicString& eventType, size_t& iterator, size_t& size)
- : eventType(eventType)
- , iterator(iterator)
- , size(size)
- {
- }
</del><ins>+typedef int ExceptionCode;
</ins><span class="cx">
</span><del>- const AtomicString& eventType;
- size_t& iterator;
- size_t& size;
- };
- typedef Vector<FiringEventIterator, 1> FiringEventIteratorVector;
</del><ins>+struct FiringEventIterator {
+ FiringEventIterator(const AtomicString& eventType, size_t& iterator, size_t& size)
+ : eventType(eventType)
+ , iterator(iterator)
+ , size(size)
+ {
+ }
</ins><span class="cx">
</span><del>- struct EventTargetData {
- WTF_MAKE_NONCOPYABLE(EventTargetData); WTF_MAKE_FAST_ALLOCATED;
- public:
- EventTargetData();
- ~EventTargetData();
</del><ins>+ const AtomicString& eventType;
+ size_t& iterator;
+ size_t& size;
+};
+typedef Vector<FiringEventIterator, 1> FiringEventIteratorVector;
</ins><span class="cx">
</span><del>- EventListenerMap eventListenerMap;
- std::unique_ptr<FiringEventIteratorVector> firingEventIterators;
- };
</del><ins>+struct EventTargetData {
+ WTF_MAKE_NONCOPYABLE(EventTargetData); WTF_MAKE_FAST_ALLOCATED;
+public:
+ EventTargetData();
+ ~EventTargetData();
</ins><span class="cx">
</span><del>- enum EventTargetInterface {
</del><ins>+ EventListenerMap eventListenerMap;
+ std::unique_ptr<FiringEventIteratorVector> firingEventIterators;
+};
</ins><span class="cx">
</span><del>- #define DOM_EVENT_INTERFACE_DECLARE(name) name##EventTargetInterfaceType,
- DOM_EVENT_TARGET_INTERFACES_FOR_EACH(DOM_EVENT_INTERFACE_DECLARE)
- #undef DOM_EVENT_INTERFACE_DECLARE
</del><ins>+enum EventTargetInterface {
</ins><span class="cx">
</span><del>- };
</del><ins>+#define DOM_EVENT_INTERFACE_DECLARE(name) name##EventTargetInterfaceType,
+DOM_EVENT_TARGET_INTERFACES_FOR_EACH(DOM_EVENT_INTERFACE_DECLARE)
+#undef DOM_EVENT_INTERFACE_DECLARE
</ins><span class="cx">
</span><del>- class EventTarget {
- public:
- void ref() { refEventTarget(); }
- void deref() { derefEventTarget(); }
</del><ins>+};
</ins><span class="cx">
</span><del>- virtual EventTargetInterface eventTargetInterface() const = 0;
- virtual ScriptExecutionContext* scriptExecutionContext() const = 0;
</del><ins>+class EventTarget {
+public:
+ void ref() { refEventTarget(); }
+ void deref() { derefEventTarget(); }
</ins><span class="cx">
</span><del>- virtual Node* toNode();
- virtual DOMWindow* toDOMWindow();
- virtual bool isMessagePort() const;
</del><ins>+ virtual EventTargetInterface eventTargetInterface() const = 0;
+ virtual ScriptExecutionContext* scriptExecutionContext() const = 0;
</ins><span class="cx">
</span><del>- virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
- virtual bool removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture);
- virtual void removeAllEventListeners();
- virtual bool dispatchEvent(PassRefPtr<Event>);
- bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); // DOM API
- virtual void uncaughtExceptionInEventHandler();
</del><ins>+ virtual Node* toNode();
+ virtual DOMWindow* toDOMWindow();
+ virtual bool isMessagePort() const;
</ins><span class="cx">
</span><del>- // Used for legacy "onEvent" attribute APIs.
- bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
- bool clearAttributeEventListener(const AtomicString& eventType);
- EventListener* getAttributeEventListener(const AtomicString& eventType);
</del><ins>+ virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
+ virtual bool removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture);
+ virtual void removeAllEventListeners();
+ virtual bool dispatchEvent(PassRefPtr<Event>);
+ bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); // DOM API
+ virtual void uncaughtExceptionInEventHandler();
</ins><span class="cx">
</span><del>- bool hasEventListeners() const;
- bool hasEventListeners(const AtomicString& eventType);
- bool hasCapturingEventListeners(const AtomicString& eventType);
- const EventListenerVector& getEventListeners(const AtomicString& eventType);
</del><ins>+ // Used for legacy "onEvent" attribute APIs.
+ bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
+ bool clearAttributeEventListener(const AtomicString& eventType);
+ EventListener* getAttributeEventListener(const AtomicString& eventType);
</ins><span class="cx">
</span><del>- bool fireEventListeners(Event*);
- bool isFiringEventListeners();
</del><ins>+ bool hasEventListeners() const;
+ bool hasEventListeners(const AtomicString& eventType);
+ bool hasCapturingEventListeners(const AtomicString& eventType);
+ const EventListenerVector& getEventListeners(const AtomicString& eventType);
</ins><span class="cx">
</span><del>- void visitJSEventListeners(JSC::SlotVisitor&);
- void invalidateJSEventListeners(JSC::JSObject*);
</del><ins>+ bool fireEventListeners(Event*);
+ bool isFiringEventListeners();
</ins><span class="cx">
</span><del>- protected:
- virtual ~EventTarget();
-
- virtual EventTargetData* eventTargetData() = 0;
- virtual EventTargetData& ensureEventTargetData() = 0;
</del><ins>+ void visitJSEventListeners(JSC::SlotVisitor&);
+ void invalidateJSEventListeners(JSC::JSObject*);
</ins><span class="cx">
</span><del>- private:
- virtual void refEventTarget() = 0;
- virtual void derefEventTarget() = 0;
-
- void fireEventListeners(Event*, EventTargetData*, EventListenerVector&);
</del><ins>+protected:
+ virtual ~EventTarget();
+
+ virtual EventTargetData* eventTargetData() = 0;
+ virtual EventTargetData& ensureEventTargetData() = 0;
</ins><span class="cx">
</span><del>- friend class EventListenerIterator;
- };
</del><ins>+private:
+ virtual void refEventTarget() = 0;
+ virtual void derefEventTarget() = 0;
+
+ void fireEventListeners(Event*, EventTargetData*, EventListenerVector&);
</ins><span class="cx">
</span><del>- class EventTargetWithInlineData : public EventTarget {
- protected:
- virtual EventTargetData* eventTargetData() override final { return &m_eventTargetData; }
- virtual EventTargetData& ensureEventTargetData() override final { return m_eventTargetData; }
- private:
- EventTargetData m_eventTargetData;
- };
</del><ins>+ friend class EventListenerIterator;
+};
</ins><span class="cx">
</span><del>- inline void EventTarget::visitJSEventListeners(JSC::SlotVisitor& visitor)
- {
- EventListenerIterator iterator(this);
- while (EventListener* listener = iterator.nextListener())
- listener->visitJSFunction(visitor);
- }
</del><ins>+class EventTargetWithInlineData : public EventTarget {
+protected:
+ virtual EventTargetData* eventTargetData() override final { return &m_eventTargetData; }
+ virtual EventTargetData& ensureEventTargetData() override final { return m_eventTargetData; }
+private:
+ EventTargetData m_eventTargetData;
+};
</ins><span class="cx">
</span><del>- inline bool EventTarget::isFiringEventListeners()
- {
- EventTargetData* d = eventTargetData();
- if (!d)
- return false;
- return d->firingEventIterators && !d->firingEventIterators->isEmpty();
- }
</del><ins>+inline void EventTarget::visitJSEventListeners(JSC::SlotVisitor& visitor)
+{
+ EventListenerIterator iterator(this);
+ while (EventListener* listener = iterator.nextListener())
+ listener->visitJSFunction(visitor);
+}
</ins><span class="cx">
</span><del>- inline bool EventTarget::hasEventListeners() const
- {
- EventTargetData* d = const_cast<EventTarget*>(this)->eventTargetData();
- if (!d)
- return false;
- return !d->eventListenerMap.isEmpty();
- }
</del><ins>+inline bool EventTarget::isFiringEventListeners()
+{
+ EventTargetData* d = eventTargetData();
+ if (!d)
+ return false;
+ return d->firingEventIterators && !d->firingEventIterators->isEmpty();
+}
</ins><span class="cx">
</span><del>- inline bool EventTarget::hasEventListeners(const AtomicString& eventType)
- {
- EventTargetData* d = eventTargetData();
- if (!d)
- return false;
- return d->eventListenerMap.contains(eventType);
- }
</del><ins>+inline bool EventTarget::hasEventListeners() const
+{
+ EventTargetData* d = const_cast<EventTarget*>(this)->eventTargetData();
+ if (!d)
+ return false;
+ return !d->eventListenerMap.isEmpty();
+}
</ins><span class="cx">
</span><del>- inline bool EventTarget::hasCapturingEventListeners(const AtomicString& eventType)
- {
- EventTargetData* d = eventTargetData();
- if (!d)
- return false;
- return d->eventListenerMap.containsCapturing(eventType);
- }
</del><ins>+inline bool EventTarget::hasEventListeners(const AtomicString& eventType)
+{
+ EventTargetData* d = eventTargetData();
+ if (!d)
+ return false;
+ return d->eventListenerMap.contains(eventType);
+}
</ins><span class="cx">
</span><ins>+inline bool EventTarget::hasCapturingEventListeners(const AtomicString& eventType)
+{
+ EventTargetData* d = eventTargetData();
+ if (!d)
+ return false;
+ return d->eventListenerMap.containsCapturing(eventType);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // EventTarget_h
</span></span></pre>
</div>
</div>
</body>
</html>