Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Side by Side Diff: third_party/WebKit/Source/core/events/Event.cpp

Issue 1817453002: Implement Event.relatedTargetScoped (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 || eventType == EventTypeNames::selectstart 47 || eventType == EventTypeNames::selectstart
48 || eventType == EventTypeNames::slotchange); 48 || eventType == EventTypeNames::slotchange);
49 } 49 }
50 50
51 Event::Event() 51 Event::Event()
52 : Event("", false, false, false) 52 : Event("", false, false, false)
53 { 53 {
54 } 54 }
55 55
56 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g) 56 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g)
57 : Event(eventType, canBubbleArg, cancelableArg, defaultScopedFromEventType(e ventType), monotonicallyIncreasingTime()) 57 : Event(eventType, canBubbleArg, cancelableArg, defaultScopedFromEventType(e ventType), false, monotonicallyIncreasingTime())
58 {
59 }
60
61 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, EventTarget* relatedTarget)
62 : Event(eventType, canBubbleArg, cancelableArg, defaultScopedFromEventType(e ventType), relatedTarget ? true : false, monotonicallyIncreasingTime())
58 { 63 {
59 } 64 }
60 65
61 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, double platformTimeStamp) 66 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, double platformTimeStamp)
62 : Event(eventType, canBubbleArg, cancelableArg, defaultScopedFromEventType(e ventType), platformTimeStamp) 67 : Event(eventType, canBubbleArg, cancelableArg, defaultScopedFromEventType(e ventType), false, platformTimeStamp)
68 {
69 }
70
71 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, EventTarget* relatedTarget, double platformTimeStamp)
72 : Event(eventType, canBubbleArg, cancelableArg, defaultScopedFromEventType(e ventType), relatedTarget ? true : false, platformTimeStamp)
63 { 73 {
64 } 74 }
65 75
66 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, bool scoped) 76 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, bool scoped)
67 : Event(eventType, canBubbleArg, cancelableArg, scoped, monotonicallyIncreas ingTime()) 77 : Event(eventType, canBubbleArg, cancelableArg, scoped, false, monotonically IncreasingTime())
68 { 78 {
69 } 79 }
70 80
71 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, bool scoped, double platformTimeStamp) 81 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g, bool scoped, bool relatedTargetScoped, double platformTimeStamp)
72 : m_type(eventType) 82 : m_type(eventType)
73 , m_canBubble(canBubbleArg) 83 , m_canBubble(canBubbleArg)
74 , m_cancelable(cancelableArg) 84 , m_cancelable(cancelableArg)
75 , m_scoped(scoped) 85 , m_scoped(scoped)
86 , m_relatedTargetScoped(relatedTargetScoped)
76 , m_propagationStopped(false) 87 , m_propagationStopped(false)
77 , m_immediatePropagationStopped(false) 88 , m_immediatePropagationStopped(false)
78 , m_defaultPrevented(false) 89 , m_defaultPrevented(false)
79 , m_defaultHandled(false) 90 , m_defaultHandled(false)
80 , m_cancelBubble(false) 91 , m_cancelBubble(false)
81 , m_isTrusted(false) 92 , m_isTrusted(false)
82 , m_handlingPassive(false) 93 , m_handlingPassive(false)
83 , m_eventPhase(0) 94 , m_eventPhase(0)
84 , m_currentTarget(nullptr) 95 , m_currentTarget(nullptr)
85 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) 96 , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
86 , m_platformTimeStamp(platformTimeStamp) 97 , m_platformTimeStamp(platformTimeStamp)
87 { 98 {
88 } 99 }
89 100
90 Event::Event(const AtomicString& eventType, const EventInit& initializer) 101 Event::Event(const AtomicString& eventType, const EventInit& initializer)
91 : Event(eventType, initializer.bubbles(), initializer.cancelable(), initiali zer.scoped()) 102 : Event(eventType, initializer.bubbles(), initializer.cancelable(), initiali zer.scoped(), initializer.relatedTargetScoped(), monotonicallyIncreasingTime())
92 { 103 {
93 } 104 }
94 105
95 Event::~Event() 106 Event::~Event()
96 { 107 {
97 } 108 }
98 109
99 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg) 110 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg)
100 { 111 {
101 if (dispatched()) 112 if (dispatched())
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 350
340 DEFINE_TRACE(Event) 351 DEFINE_TRACE(Event)
341 { 352 {
342 visitor->trace(m_currentTarget); 353 visitor->trace(m_currentTarget);
343 visitor->trace(m_target); 354 visitor->trace(m_target);
344 visitor->trace(m_underlyingEvent); 355 visitor->trace(m_underlyingEvent);
345 visitor->trace(m_eventPath); 356 visitor->trace(m_eventPath);
346 } 357 }
347 358
348 } // namespace blink 359 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.h ('k') | third_party/WebKit/Source/core/events/Event.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698