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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/MouseRelatedEvent.cpp
diff --git a/Source/core/events/MouseRelatedEvent.cpp b/Source/core/events/MouseRelatedEvent.cpp
index 2da77c38f307d290c4c363c7c88e30b40c964d4c..c5be7a6a08a679f0014c9f16f8e23cf5261a8753 100644
--- a/Source/core/events/MouseRelatedEvent.cpp
+++ b/Source/core/events/MouseRelatedEvent.cpp
@@ -184,6 +184,8 @@ int MouseRelatedEvent::layerY()
int MouseRelatedEvent::offsetX()
{
+ if (isSimulated())
+ return 0;
if (!m_hasCachedRelativePosition)
computeRelativePosition();
return roundToInt(m_offsetLocation.x());
@@ -191,6 +193,8 @@ int MouseRelatedEvent::offsetX()
int MouseRelatedEvent::offsetY()
{
+ if (isSimulated())
+ return 0;
if (!m_hasCachedRelativePosition)
computeRelativePosition();
return roundToInt(m_offsetLocation.y());
« 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