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

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

Issue 918553002: Initialize all MouseEvent members in all constructors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return adoptRefWillBeNoop(new MouseEvent(type, canBubble, cancelable, view, 63 return adoptRefWillBeNoop(new MouseEvent(type, canBubble, cancelable, view,
64 detail, screenX, screenY, windowX, windowY, 64 detail, screenX, screenY, windowX, windowY,
65 movementX, movementY, 65 movementX, movementY,
66 ctrlKey, altKey, shiftKey, metaKey, button, buttons, relatedTarget, data Transfer, isSimulated, syntheticEventType, uiCreateTime)); 66 ctrlKey, altKey, shiftKey, metaKey, button, buttons, relatedTarget, data Transfer, isSimulated, syntheticEventType, uiCreateTime));
67 } 67 }
68 68
69 MouseEvent::MouseEvent() 69 MouseEvent::MouseEvent()
70 : m_button(0) 70 : m_button(0)
71 , m_buttons(0) 71 , m_buttons(0)
72 , m_buttonDown(false) 72 , m_buttonDown(false)
73 , m_relatedTarget(nullptr)
74 , m_dataTransfer(nullptr)
75 , m_syntheticEventType(PlatformMouseEvent::RealOrIndistinguishable)
73 { 76 {
74 } 77 }
75 78
76 MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance lable, PassRefPtrWillBeRawPtr<AbstractView> view, 79 MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance lable, PassRefPtrWillBeRawPtr<AbstractView> view,
77 int detail, int screenX, int screenY, int windowX, int windowY, 80 int detail, int screenX, int screenY, int windowX, int windowY,
78 int movementX, int movementY, 81 int movementX, int movementY,
79 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, 82 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
80 unsigned short button, unsigned short buttons, PassRefPtrWillBeRawPtr<EventT arget> relatedTarget, 83 unsigned short button, unsigned short buttons, PassRefPtrWillBeRawPtr<EventT arget> relatedTarget,
81 PassRefPtrWillBeRawPtr<DataTransfer> dataTransfer, bool isSimulated, Platfor mMouseEvent::SyntheticEventType syntheticEventType, 84 PassRefPtrWillBeRawPtr<DataTransfer> dataTransfer, bool isSimulated, Platfor mMouseEvent::SyntheticEventType syntheticEventType,
82 double uiCreateTime) 85 double uiCreateTime)
(...skipping 14 matching lines...) Expand all
97 MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& init ializer) 100 MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& init ializer)
98 : MouseRelatedEvent(eventType, initializer.bubbles(), initializer.cancelable (), initializer.view(), initializer.detail(), IntPoint(initializer.screenX(), in itializer.screenY()), 101 : MouseRelatedEvent(eventType, initializer.bubbles(), initializer.cancelable (), initializer.view(), initializer.detail(), IntPoint(initializer.screenX(), in itializer.screenY()),
99 IntPoint(0 /* pageX */, 0 /* pageY */), 102 IntPoint(0 /* pageX */, 0 /* pageY */),
100 IntPoint(0 /* movementX */, 0 /* movementY */), 103 IntPoint(0 /* movementX */, 0 /* movementY */),
101 initializer.ctrlKey(), initializer.altKey(), initializer.shiftKey(), ini tializer.metaKey(), false /* isSimulated */) 104 initializer.ctrlKey(), initializer.altKey(), initializer.shiftKey(), ini tializer.metaKey(), false /* isSimulated */)
102 , m_button(initializer.button() == (unsigned short)-1 ? 0 : initializer.butt on()) 105 , m_button(initializer.button() == (unsigned short)-1 ? 0 : initializer.butt on())
103 , m_buttons(initializer.buttons()) 106 , m_buttons(initializer.buttons())
104 , m_buttonDown(initializer.button() != (unsigned short)-1) 107 , m_buttonDown(initializer.button() != (unsigned short)-1)
105 , m_relatedTarget(initializer.relatedTarget()) 108 , m_relatedTarget(initializer.relatedTarget())
106 , m_dataTransfer(nullptr) 109 , m_dataTransfer(nullptr)
110 , m_syntheticEventType(PlatformMouseEvent::RealOrIndistinguishable)
107 { 111 {
108 initCoordinates(IntPoint(initializer.clientX(), initializer.clientY())); 112 initCoordinates(IntPoint(initializer.clientX(), initializer.clientY()));
109 } 113 }
110 114
111 MouseEvent::~MouseEvent() 115 MouseEvent::~MouseEvent()
112 { 116 {
113 } 117 }
114 118
115 unsigned short MouseEvent::platformModifiersToButtons(unsigned modifiers) 119 unsigned short MouseEvent::platformModifiersToButtons(unsigned modifiers)
116 { 120 {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 event().button(), relatedTarget, event().buttons()); 290 event().button(), relatedTarget, event().buttons());
287 if (event().defaultHandled()) 291 if (event().defaultHandled())
288 doubleClickEvent->setDefaultHandled(); 292 doubleClickEvent->setDefaultHandled();
289 EventDispatcher::dispatchEvent(dispatcher.node(), MouseEventDispatchMediator ::create(doubleClickEvent)); 293 EventDispatcher::dispatchEvent(dispatcher.node(), MouseEventDispatchMediator ::create(doubleClickEvent));
290 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented ()) 294 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented ())
291 return false; 295 return false;
292 return !swallowEvent; 296 return !swallowEvent;
293 } 297 }
294 298
295 } // namespace blink 299 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698