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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 || eventType == EventTypeNames::load | 45 || eventType == EventTypeNames::load |
46 || eventType == EventTypeNames::reset | 46 || eventType == EventTypeNames::reset |
47 || eventType == EventTypeNames::resize | 47 || eventType == EventTypeNames::resize |
48 || eventType == EventTypeNames::scroll | 48 || eventType == EventTypeNames::scroll |
49 || eventType == EventTypeNames::select | 49 || eventType == EventTypeNames::select |
50 || eventType == EventTypeNames::selectstart | 50 || eventType == EventTypeNames::selectstart |
51 || eventType == EventTypeNames::slotchange); | 51 || eventType == EventTypeNames::slotchange); |
52 } | 52 } |
53 | 53 |
54 Event::Event() | 54 Event::Event() |
55 : Event("", false, false, false) | 55 : Event("", false, false) |
56 { | 56 { |
57 m_wasInitialized = false; | 57 m_wasInitialized = false; |
58 } | 58 } |
59 | 59 |
60 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g) | 60 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g) |
61 : Event(eventType, canBubbleArg, cancelableArg, !isScoped(eventType), false,
monotonicallyIncreasingTime()) | 61 : Event(eventType, canBubbleArg, cancelableArg, !isScoped(eventType), monoto
nicallyIncreasingTime()) |
62 { | |
63 } | |
64 | |
65 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g, EventTarget* relatedTarget) | |
66 : Event(eventType, canBubbleArg, cancelableArg, !isScoped(eventType), relate
dTarget ? true : false, monotonicallyIncreasingTime()) | |
67 { | 62 { |
68 } | 63 } |
69 | 64 |
70 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g, double platformTimeStamp) | 65 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g, double platformTimeStamp) |
71 : Event(eventType, canBubbleArg, cancelableArg, !isScoped(eventType), false,
platformTimeStamp) | 66 : Event(eventType, canBubbleArg, cancelableArg, !isScoped(eventType), platfo
rmTimeStamp) |
72 { | 67 { |
73 } | 68 } |
74 | 69 |
75 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g, EventTarget* relatedTarget, double platformTimeStamp) | 70 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g, bool composed, double platformTimeStamp) |
76 : Event(eventType, canBubbleArg, cancelableArg, !isScoped(eventType), relate
dTarget ? true : false, platformTimeStamp) | |
77 { | |
78 } | |
79 | |
80 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g, bool composed) | |
81 : Event(eventType, canBubbleArg, cancelableArg, composed, false, monotonical
lyIncreasingTime()) | |
82 { | |
83 } | |
84 | |
85 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr
g, bool composed, bool relatedTargetScoped, double platformTimeStamp) | |
86 : m_type(eventType) | 71 : m_type(eventType) |
87 , m_canBubble(canBubbleArg) | 72 , m_canBubble(canBubbleArg) |
88 , m_cancelable(cancelableArg) | 73 , m_cancelable(cancelableArg) |
89 , m_composed(composed) | 74 , m_composed(composed) |
90 , m_relatedTargetScoped(relatedTargetScoped) | |
91 , m_propagationStopped(false) | 75 , m_propagationStopped(false) |
92 , m_immediatePropagationStopped(false) | 76 , m_immediatePropagationStopped(false) |
93 , m_defaultPrevented(false) | 77 , m_defaultPrevented(false) |
94 , m_defaultHandled(false) | 78 , m_defaultHandled(false) |
95 , m_cancelBubble(false) | 79 , m_cancelBubble(false) |
96 , m_wasInitialized(true) | 80 , m_wasInitialized(true) |
97 , m_isTrusted(false) | 81 , m_isTrusted(false) |
98 , m_handlingPassive(false) | 82 , m_handlingPassive(false) |
99 , m_eventPhase(0) | 83 , m_eventPhase(0) |
100 , m_currentTarget(nullptr) | 84 , m_currentTarget(nullptr) |
101 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) | 85 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) |
102 , m_platformTimeStamp(platformTimeStamp) | 86 , m_platformTimeStamp(platformTimeStamp) |
103 { | 87 { |
104 } | 88 } |
105 | 89 |
106 Event::Event(const AtomicString& eventType, const EventInit& initializer) | 90 Event::Event(const AtomicString& eventType, const EventInit& initializer) |
107 : Event(eventType, initializer.bubbles(), initializer.cancelable(), initiali
zer.composed(), initializer.relatedTargetScoped(), monotonicallyIncreasingTime()
) | 91 : Event(eventType, initializer.bubbles(), initializer.cancelable(), initiali
zer.composed(), monotonicallyIncreasingTime()) |
108 { | 92 { |
109 } | 93 } |
110 | 94 |
111 Event::~Event() | 95 Event::~Event() |
112 { | 96 { |
113 } | 97 } |
114 | 98 |
115 bool Event::isScopedInV0() const | 99 bool Event::isScopedInV0() const |
116 { | 100 { |
117 return isTrusted() && isScoped(m_type); | 101 return isTrusted() && isScoped(m_type); |
(...skipping 11 matching lines...) Expand all Loading... |
129 | 113 |
130 m_wasInitialized = true; | 114 m_wasInitialized = true; |
131 m_propagationStopped = false; | 115 m_propagationStopped = false; |
132 m_immediatePropagationStopped = false; | 116 m_immediatePropagationStopped = false; |
133 m_defaultPrevented = false; | 117 m_defaultPrevented = false; |
134 m_isTrusted = false; | 118 m_isTrusted = false; |
135 | 119 |
136 m_type = eventTypeArg; | 120 m_type = eventTypeArg; |
137 m_canBubble = canBubbleArg; | 121 m_canBubble = canBubbleArg; |
138 m_cancelable = cancelableArg; | 122 m_cancelable = cancelableArg; |
139 | |
140 m_relatedTargetScoped = relatedTarget ? true : false; | |
141 } | 123 } |
142 | 124 |
143 bool Event::legacyReturnValue(ExecutionContext* executionContext) const | 125 bool Event::legacyReturnValue(ExecutionContext* executionContext) const |
144 { | 126 { |
145 bool returnValue = !defaultPrevented(); | 127 bool returnValue = !defaultPrevented(); |
146 if (returnValue) | 128 if (returnValue) |
147 UseCounter::count(executionContext, UseCounter::EventGetReturnValueTrue)
; | 129 UseCounter::count(executionContext, UseCounter::EventGetReturnValueTrue)
; |
148 else | 130 else |
149 UseCounter::count(executionContext, UseCounter::EventGetReturnValueFalse
); | 131 UseCounter::count(executionContext, UseCounter::EventGetReturnValueFalse
); |
150 return returnValue; | 132 return returnValue; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 359 |
378 DEFINE_TRACE(Event) | 360 DEFINE_TRACE(Event) |
379 { | 361 { |
380 visitor->trace(m_currentTarget); | 362 visitor->trace(m_currentTarget); |
381 visitor->trace(m_target); | 363 visitor->trace(m_target); |
382 visitor->trace(m_underlyingEvent); | 364 visitor->trace(m_underlyingEvent); |
383 visitor->trace(m_eventPath); | 365 visitor->trace(m_eventPath); |
384 } | 366 } |
385 | 367 |
386 } // namespace blink | 368 } // namespace blink |
OLD | NEW |