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

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

Issue 1233233003: Add Event.isTrusted support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master_event_trusted_main2
Patch Set: Fix nits Created 5 years, 5 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
« no previous file with comments | « Source/core/events/Event.h ('k') | Source/core/events/Event.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29 matching lines...) Expand all
40 40
41 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g) 41 Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableAr g)
42 : m_type(eventType) 42 : m_type(eventType)
43 , m_canBubble(canBubbleArg) 43 , m_canBubble(canBubbleArg)
44 , m_cancelable(cancelableArg) 44 , m_cancelable(cancelableArg)
45 , m_propagationStopped(false) 45 , m_propagationStopped(false)
46 , m_immediatePropagationStopped(false) 46 , m_immediatePropagationStopped(false)
47 , m_defaultPrevented(false) 47 , m_defaultPrevented(false)
48 , m_defaultHandled(false) 48 , m_defaultHandled(false)
49 , m_cancelBubble(false) 49 , m_cancelBubble(false)
50 , m_isTrusted(false)
50 , m_eventPhase(0) 51 , m_eventPhase(0)
51 , m_currentTarget(nullptr) 52 , m_currentTarget(nullptr)
52 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) 53 , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
53 , m_uiCreateTime(0) 54 , m_uiCreateTime(0)
54 { 55 {
55 } 56 }
56 57
57 Event::Event(const AtomicString& eventType, const EventInit& initializer) 58 Event::Event(const AtomicString& eventType, const EventInit& initializer)
58 : Event(eventType, initializer.bubbles(), initializer.cancelable()) 59 : Event(eventType, initializer.bubbles(), initializer.cancelable())
59 { 60 {
60 } 61 }
61 62
62 Event::~Event() 63 Event::~Event()
63 { 64 {
64 } 65 }
65 66
66 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg) 67 void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg)
67 { 68 {
68 if (dispatched()) 69 if (dispatched())
69 return; 70 return;
70 71
71 m_propagationStopped = false; 72 m_propagationStopped = false;
72 m_immediatePropagationStopped = false; 73 m_immediatePropagationStopped = false;
73 m_defaultPrevented = false; 74 m_defaultPrevented = false;
75 m_isTrusted = false;
74 76
75 m_type = eventTypeArg; 77 m_type = eventTypeArg;
76 m_canBubble = canBubbleArg; 78 m_canBubble = canBubbleArg;
77 m_cancelable = cancelableArg; 79 m_cancelable = cancelableArg;
78 } 80 }
79 81
80 bool Event::legacyReturnValue(ExecutionContext* executionContext) const 82 bool Event::legacyReturnValue(ExecutionContext* executionContext) const
81 { 83 {
82 bool returnValue = !defaultPrevented(); 84 bool returnValue = !defaultPrevented();
83 if (returnValue) 85 if (returnValue)
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 259
258 DEFINE_TRACE(Event) 260 DEFINE_TRACE(Event)
259 { 261 {
260 visitor->trace(m_currentTarget); 262 visitor->trace(m_currentTarget);
261 visitor->trace(m_target); 263 visitor->trace(m_target);
262 visitor->trace(m_underlyingEvent); 264 visitor->trace(m_underlyingEvent);
263 visitor->trace(m_eventPath); 265 visitor->trace(m_eventPath);
264 } 266 }
265 267
266 } // namespace blink 268 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/events/Event.h ('k') | Source/core/events/Event.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698