| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 , m_composed(composedMode == ComposedMode::Composed) | 74 , m_composed(composedMode == ComposedMode::Composed) |
| 75 , m_isEventTypeScopedInV0(isEventTypeScopedInV0(eventType)) | 75 , m_isEventTypeScopedInV0(isEventTypeScopedInV0(eventType)) |
| 76 , m_propagationStopped(false) | 76 , m_propagationStopped(false) |
| 77 , m_immediatePropagationStopped(false) | 77 , m_immediatePropagationStopped(false) |
| 78 , m_defaultPrevented(false) | 78 , m_defaultPrevented(false) |
| 79 , m_defaultHandled(false) | 79 , m_defaultHandled(false) |
| 80 , m_cancelBubble(false) | 80 , m_cancelBubble(false) |
| 81 , m_wasInitialized(true) | 81 , m_wasInitialized(true) |
| 82 , m_isTrusted(false) | 82 , m_isTrusted(false) |
| 83 , m_handlingPassive(false) | 83 , m_handlingPassive(false) |
| 84 , m_preventDefaultCalledOnUncancelableEvent(false) |
| 84 , m_eventPhase(0) | 85 , m_eventPhase(0) |
| 85 , m_currentTarget(nullptr) | 86 , m_currentTarget(nullptr) |
| 86 , m_platformTimeStamp(platformTimeStamp) | 87 , m_platformTimeStamp(platformTimeStamp) |
| 87 { | 88 { |
| 88 } | 89 } |
| 89 | 90 |
| 90 Event::Event(const AtomicString& eventType, const EventInit& initializer) | 91 Event::Event(const AtomicString& eventType, const EventInit& initializer) |
| 91 : Event(eventType, initializer.bubbles(), initializer.cancelable(), initiali
zer.composed() ? ComposedMode::Composed : ComposedMode::Scoped, monotonicallyInc
reasingTime()) | 92 : Event(eventType, initializer.bubbles(), initializer.cancelable(), initiali
zer.composed() ? ComposedMode::Composed : ComposedMode::Scoped, monotonicallyInc
reasingTime()) |
| 92 { | 93 { |
| 93 } | 94 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 109 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool
cancelableArg, EventTarget* relatedTarget) | 110 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool
cancelableArg, EventTarget* relatedTarget) |
| 110 { | 111 { |
| 111 if (isBeingDispatched()) | 112 if (isBeingDispatched()) |
| 112 return; | 113 return; |
| 113 | 114 |
| 114 m_wasInitialized = true; | 115 m_wasInitialized = true; |
| 115 m_propagationStopped = false; | 116 m_propagationStopped = false; |
| 116 m_immediatePropagationStopped = false; | 117 m_immediatePropagationStopped = false; |
| 117 m_defaultPrevented = false; | 118 m_defaultPrevented = false; |
| 118 m_isTrusted = false; | 119 m_isTrusted = false; |
| 120 m_preventDefaultCalledOnUncancelableEvent = false; |
| 119 | 121 |
| 120 m_type = eventTypeArg; | 122 m_type = eventTypeArg; |
| 121 m_canBubble = canBubbleArg; | 123 m_canBubble = canBubbleArg; |
| 122 m_cancelable = cancelableArg; | 124 m_cancelable = cancelableArg; |
| 123 } | 125 } |
| 124 | 126 |
| 125 bool Event::legacyReturnValue(ExecutionContext* executionContext) const | 127 bool Event::legacyReturnValue(ExecutionContext* executionContext) const |
| 126 { | 128 { |
| 127 bool returnValue = !defaultPrevented(); | 129 bool returnValue = !defaultPrevented(); |
| 128 if (returnValue) | 130 if (returnValue) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 if (m_handlingPassive) { | 228 if (m_handlingPassive) { |
| 227 m_preventDefaultCalledDuringPassive = true; | 229 m_preventDefaultCalledDuringPassive = true; |
| 228 const LocalDOMWindow* window = m_eventPath ? m_eventPath->windowEventCon
text().window() : 0; | 230 const LocalDOMWindow* window = m_eventPath ? m_eventPath->windowEventCon
text().window() : 0; |
| 229 if (window) | 231 if (window) |
| 230 window->printErrorMessage("Unable to preventDefault inside passive e
vent listener invocation."); | 232 window->printErrorMessage("Unable to preventDefault inside passive e
vent listener invocation."); |
| 231 return; | 233 return; |
| 232 } | 234 } |
| 233 | 235 |
| 234 if (m_cancelable) | 236 if (m_cancelable) |
| 235 m_defaultPrevented = true; | 237 m_defaultPrevented = true; |
| 238 else |
| 239 m_preventDefaultCalledOnUncancelableEvent = true; |
| 236 } | 240 } |
| 237 | 241 |
| 238 void Event::setTarget(EventTarget* target) | 242 void Event::setTarget(EventTarget* target) |
| 239 { | 243 { |
| 240 if (m_target == target) | 244 if (m_target == target) |
| 241 return; | 245 return; |
| 242 | 246 |
| 243 m_target = target; | 247 m_target = target; |
| 244 if (m_target) | 248 if (m_target) |
| 245 receivedTarget(); | 249 receivedTarget(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 351 |
| 348 DEFINE_TRACE(Event) | 352 DEFINE_TRACE(Event) |
| 349 { | 353 { |
| 350 visitor->trace(m_currentTarget); | 354 visitor->trace(m_currentTarget); |
| 351 visitor->trace(m_target); | 355 visitor->trace(m_target); |
| 352 visitor->trace(m_underlyingEvent); | 356 visitor->trace(m_underlyingEvent); |
| 353 visitor->trace(m_eventPath); | 357 visitor->trace(m_eventPath); |
| 354 } | 358 } |
| 355 | 359 |
| 356 } // namespace blink | 360 } // namespace blink |
| OLD | NEW |