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

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

Issue 316733004: MouseEvent.offsetX/Y should just return 0,0 for simulated clicks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt ('k') | 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 int MouseRelatedEvent::layerY() 178 int MouseRelatedEvent::layerY()
179 { 179 {
180 if (!m_hasCachedRelativePosition) 180 if (!m_hasCachedRelativePosition)
181 computeRelativePosition(); 181 computeRelativePosition();
182 return m_layerLocation.y(); 182 return m_layerLocation.y();
183 } 183 }
184 184
185 int MouseRelatedEvent::offsetX() 185 int MouseRelatedEvent::offsetX()
186 { 186 {
187 if (isSimulated())
188 return 0;
187 if (!m_hasCachedRelativePosition) 189 if (!m_hasCachedRelativePosition)
188 computeRelativePosition(); 190 computeRelativePosition();
189 return roundToInt(m_offsetLocation.x()); 191 return roundToInt(m_offsetLocation.x());
190 } 192 }
191 193
192 int MouseRelatedEvent::offsetY() 194 int MouseRelatedEvent::offsetY()
193 { 195 {
196 if (isSimulated())
197 return 0;
194 if (!m_hasCachedRelativePosition) 198 if (!m_hasCachedRelativePosition)
195 computeRelativePosition(); 199 computeRelativePosition();
196 return roundToInt(m_offsetLocation.y()); 200 return roundToInt(m_offsetLocation.y());
197 } 201 }
198 202
199 int MouseRelatedEvent::pageX() const 203 int MouseRelatedEvent::pageX() const
200 { 204 {
201 return m_pageLocation.x(); 205 return m_pageLocation.x();
202 } 206 }
203 207
(...skipping 15 matching lines...) Expand all
219 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events .html>. 223 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events .html>.
220 return m_clientLocation.y(); 224 return m_clientLocation.y();
221 } 225 }
222 226
223 void MouseRelatedEvent::trace(Visitor* visitor) 227 void MouseRelatedEvent::trace(Visitor* visitor)
224 { 228 {
225 UIEventWithKeyState::trace(visitor); 229 UIEventWithKeyState::trace(visitor);
226 } 230 }
227 231
228 } // namespace WebCore 232 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698