| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "gen/sky/core/EventHeaders.h" | 26 #include "gen/sky/core/EventHeaders.h" |
| 27 #include "gen/sky/core/EventInterfaces.h" | 27 #include "gen/sky/core/EventInterfaces.h" |
| 28 #include "sky/engine/core/dom/StaticNodeList.h" | 28 #include "sky/engine/core/dom/StaticNodeList.h" |
| 29 #include "sky/engine/core/events/EventTarget.h" | 29 #include "sky/engine/core/events/EventTarget.h" |
| 30 #include "sky/engine/wtf/CurrentTime.h" | 30 #include "sky/engine/wtf/CurrentTime.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 Event::Event() | 34 Event::Event() |
| 35 : m_canBubble(false) | 35 : m_timeStamp(currentTimeMS()) |
| 36 , m_canBubble(false) |
| 36 , m_cancelable(false) | 37 , m_cancelable(false) |
| 37 , m_propagationStopped(false) | 38 , m_propagationStopped(false) |
| 38 , m_immediatePropagationStopped(false) | 39 , m_immediatePropagationStopped(false) |
| 39 , m_defaultPrevented(false) | 40 , m_defaultPrevented(false) |
| 40 , m_defaultHandled(false) | 41 , m_defaultHandled(false) |
| 41 , m_cancelBubble(false) | 42 , m_cancelBubble(false) |
| 42 , m_eventPhase(0) | 43 , m_eventPhase(0) |
| 43 , m_currentTarget(nullptr) | 44 , m_currentTarget(nullptr) |
| 44 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) | |
| 45 { | 45 { |
| 46 } | 46 } |
| 47 | 47 |
| 48 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g) | 48 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g) |
| 49 : m_type(eventType) | 49 : m_timeStamp(currentTimeMS()) |
| 50 , m_type(eventType) |
| 50 , m_canBubble(canBubbleArg) | 51 , m_canBubble(canBubbleArg) |
| 51 , m_cancelable(cancelableArg) | 52 , m_cancelable(cancelableArg) |
| 52 , m_propagationStopped(false) | 53 , m_propagationStopped(false) |
| 53 , m_immediatePropagationStopped(false) | 54 , m_immediatePropagationStopped(false) |
| 54 , m_defaultPrevented(false) | 55 , m_defaultPrevented(false) |
| 55 , m_defaultHandled(false) | 56 , m_defaultHandled(false) |
| 56 , m_cancelBubble(false) | 57 , m_cancelBubble(false) |
| 57 , m_eventPhase(0) | 58 , m_eventPhase(0) |
| 58 , m_currentTarget(nullptr) | 59 , m_currentTarget(nullptr) |
| 59 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) | |
| 60 { | 60 { |
| 61 } | 61 } |
| 62 | 62 |
| 63 Event::Event(const AtomicString& eventType, const EventInit& initializer) | 63 Event::Event(const AtomicString& eventType, const EventInit& initializer) |
| 64 : m_type(eventType) | 64 : m_timeStamp(currentTimeMS()) |
| 65 , m_type(eventType) |
| 65 , m_canBubble(initializer.bubbles) | 66 , m_canBubble(initializer.bubbles) |
| 66 , m_cancelable(initializer.cancelable) | 67 , m_cancelable(initializer.cancelable) |
| 67 , m_propagationStopped(false) | 68 , m_propagationStopped(false) |
| 68 , m_immediatePropagationStopped(false) | 69 , m_immediatePropagationStopped(false) |
| 69 , m_defaultPrevented(false) | 70 , m_defaultPrevented(false) |
| 70 , m_defaultHandled(false) | 71 , m_defaultHandled(false) |
| 71 , m_cancelBubble(false) | 72 , m_cancelBubble(false) |
| 72 , m_eventPhase(0) | 73 , m_eventPhase(0) |
| 73 , m_currentTarget(nullptr) | 74 , m_currentTarget(nullptr) |
| 74 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) | |
| 75 { | 75 { |
| 76 } | 76 } |
| 77 | 77 |
| 78 Event::~Event() | 78 Event::~Event() |
| 79 { | 79 { |
| 80 } | 80 } |
| 81 | 81 |
| 82 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool
cancelableArg) | 82 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool
cancelableArg) |
| 83 { | 83 { |
| 84 if (dispatched()) | 84 if (dispatched()) |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 return StaticNodeList::createEmpty(); | 197 return StaticNodeList::createEmpty(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 EventTarget* Event::currentTarget() const | 200 EventTarget* Event::currentTarget() const |
| 201 { | 201 { |
| 202 return m_currentTarget.get(); | 202 return m_currentTarget.get(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace blink | 205 } // namespace blink |
| OLD | NEW |