#include "bindings/v8/ScriptWrappable.h"
#include "core/dom/DOMTimeStamp.h"
#include "core/events/EventPath.h"
-#include "heap/Handle.h"
+#include "platform/heap/Handle.h"
#include "wtf/RefCounted.h"
#include "wtf/text/AtomicString.h"
class EventTarget;
class EventDispatcher;
+class ExecutionContext;
class HTMLIFrameElement;
struct EventInit {
bool cancelable;
};
-class Event : public RefCountedWillBeRefCountedGarbageCollected<Event>, public ScriptWrappable {
+class Event : public RefCountedWillBeGarbageCollectedFinalized<Event>, public ScriptWrappable {
public:
enum PhaseType {
NONE = 0,
static PassRefPtrWillBeRawPtr<Event> create()
{
- return adoptRefWillBeRefCountedGarbageCollected(new Event);
+ return adoptRefWillBeNoop(new Event);
}
// A factory for a simple event. The event doesn't bubble, and isn't
// http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#fire-a-simple-event
static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type)
{
- return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, false));
+ return adoptRefWillBeNoop(new Event(type, false, false));
}
static PassRefPtrWillBeRawPtr<Event> createCancelable(const AtomicString& type)
{
- return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, true));
+ return adoptRefWillBeNoop(new Event(type, false, true));
}
static PassRefPtrWillBeRawPtr<Event> createBubble(const AtomicString& type)
{
- return adoptRefWillBeRefCountedGarbageCollected(new Event(type, true, false));
+ return adoptRefWillBeNoop(new Event(type, true, false));
}
static PassRefPtrWillBeRawPtr<Event> createCancelableBubble(const AtomicString& type)
{
- return adoptRefWillBeRefCountedGarbageCollected(new Event(type, true, true));
+ return adoptRefWillBeNoop(new Event(type, true, true));
}
static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type, const EventInit& initializer)
{
- return adoptRefWillBeRefCountedGarbageCollected(new Event(type, initializer));
+ return adoptRefWillBeNoop(new Event(type, initializer));
}
virtual ~Event();
// IE Extensions
EventTarget* srcElement() const { return target(); } // MSIE extension - "the object that fired the event"
- bool legacyReturnValue() const { return !defaultPrevented(); }
- void setLegacyReturnValue(bool returnValue) { setDefaultPrevented(!returnValue); }
+ bool legacyReturnValue(ExecutionContext*) const;
+ void setLegacyReturnValue(ExecutionContext*, bool returnValue);
virtual const AtomicString& interfaceName() const;
bool hasInterface(const AtomicString&) const;
bool immediatePropagationStopped() const { return m_immediatePropagationStopped; }
bool defaultPrevented() const { return m_defaultPrevented; }
- void preventDefault()
+ virtual void preventDefault()
{
if (m_cancelable)
m_defaultPrevented = true;
void setCancelBubble(bool cancel) { m_cancelBubble = cancel; }
Event* underlyingEvent() const { return m_underlyingEvent.get(); }
- void setUnderlyingEvent(PassRefPtr<Event>);
+ void setUnderlyingEvent(PassRefPtrWillBeRawPtr<Event>);
EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; }
EventPath& ensureEventPath();
EventTarget* m_currentTarget;
RefPtr<EventTarget> m_target;
DOMTimeStamp m_createTime;
- RefPtr<Event> m_underlyingEvent;
- OwnPtr<EventPath> m_eventPath;
+ RefPtrWillBeMember<Event> m_underlyingEvent;
+ OwnPtrWillBeMember<EventPath> m_eventPath;
};
#define DEFINE_EVENT_TYPE_CASTS(typeName) \