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 69 matching lines...) Loading... |
80 TimeTicks platformTimeStamp) | 80 TimeTicks platformTimeStamp) |
81 : m_type(eventType), | 81 : m_type(eventType), |
82 m_canBubble(canBubbleArg), | 82 m_canBubble(canBubbleArg), |
83 m_cancelable(cancelableArg), | 83 m_cancelable(cancelableArg), |
84 m_composed(composedMode == ComposedMode::Composed), | 84 m_composed(composedMode == ComposedMode::Composed), |
85 m_isEventTypeScopedInV0(isEventTypeScopedInV0(eventType)), | 85 m_isEventTypeScopedInV0(isEventTypeScopedInV0(eventType)), |
86 m_propagationStopped(false), | 86 m_propagationStopped(false), |
87 m_immediatePropagationStopped(false), | 87 m_immediatePropagationStopped(false), |
88 m_defaultPrevented(false), | 88 m_defaultPrevented(false), |
89 m_defaultHandled(false), | 89 m_defaultHandled(false), |
90 m_cancelBubble(false), | |
91 m_wasInitialized(true), | 90 m_wasInitialized(true), |
92 m_isTrusted(false), | 91 m_isTrusted(false), |
93 m_preventDefaultCalledOnUncancelableEvent(false), | 92 m_preventDefaultCalledOnUncancelableEvent(false), |
94 m_handlingPassive(PassiveMode::NotPassiveDefault), | 93 m_handlingPassive(PassiveMode::NotPassiveDefault), |
95 m_eventPhase(0), | 94 m_eventPhase(0), |
96 m_currentTarget(nullptr), | 95 m_currentTarget(nullptr), |
97 m_platformTimeStamp(platformTimeStamp) {} | 96 m_platformTimeStamp(platformTimeStamp) {} |
98 | 97 |
99 Event::Event(const AtomicString& eventType, const EventInit& initializer) | 98 Event::Event(const AtomicString& eventType, const EventInit& initializer) |
100 : Event(eventType, | 99 : Event(eventType, |
(...skipping 229 matching lines...) Loading... |
330 DOMWindowPerformance::performance(*scriptState->domWindow()); | 329 DOMWindowPerformance::performance(*scriptState->domWindow()); |
331 double timestampSeconds = (m_platformTimeStamp - TimeTicks()).InSecondsF(); | 330 double timestampSeconds = (m_platformTimeStamp - TimeTicks()).InSecondsF(); |
332 timeStamp = | 331 timeStamp = |
333 performance->monotonicTimeToDOMHighResTimeStamp(timestampSeconds); | 332 performance->monotonicTimeToDOMHighResTimeStamp(timestampSeconds); |
334 } | 333 } |
335 | 334 |
336 return timeStamp; | 335 return timeStamp; |
337 } | 336 } |
338 | 337 |
339 void Event::setCancelBubble(ExecutionContext* context, bool cancel) { | 338 void Event::setCancelBubble(ExecutionContext* context, bool cancel) { |
340 if (!m_cancelBubble && cancel) | 339 if (cancel) |
341 UseCounter::count(context, UseCounter::EventCancelBubbleWasChangedToTrue); | 340 m_propagationStopped = true; |
342 else if (m_cancelBubble && !cancel) | |
343 UseCounter::count(context, UseCounter::EventCancelBubbleWasChangedToFalse); | |
344 m_cancelBubble = cancel; | |
345 } | 341 } |
346 | 342 |
347 DEFINE_TRACE(Event) { | 343 DEFINE_TRACE(Event) { |
348 visitor->trace(m_currentTarget); | 344 visitor->trace(m_currentTarget); |
349 visitor->trace(m_target); | 345 visitor->trace(m_target); |
350 visitor->trace(m_underlyingEvent); | 346 visitor->trace(m_underlyingEvent); |
351 visitor->trace(m_eventPath); | 347 visitor->trace(m_eventPath); |
352 } | 348 } |
353 | 349 |
354 } // namespace blink | 350 } // namespace blink |
OLD | NEW |