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

Unified Diff: third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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
Index: third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp b/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
index 8f0ff4f641ba5ac09afa471e3a31b380f3835e83..17f4d1c9681d46792c1f6a28d892ef8dd0f982aa 100644
--- a/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
+++ b/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
@@ -199,14 +199,14 @@ int MouseRelatedEvent::layerX()
{
if (!m_hasCachedRelativePosition)
computeRelativePosition();
- return m_layerLocation.x();
+ return m_layerLocation.x().toInt();
}
int MouseRelatedEvent::layerY()
{
if (!m_hasCachedRelativePosition)
computeRelativePosition();
- return m_layerLocation.y();
+ return m_layerLocation.y().toInt();
}
int MouseRelatedEvent::offsetX()
@@ -229,26 +229,26 @@ int MouseRelatedEvent::offsetY()
int MouseRelatedEvent::pageX() const
{
- return m_pageLocation.x();
+ return m_pageLocation.x().toInt();
}
int MouseRelatedEvent::pageY() const
{
- return m_pageLocation.y();
+ return m_pageLocation.y().toInt();
}
int MouseRelatedEvent::x() const
{
// FIXME: This is not correct.
// See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>.
- return m_clientLocation.x();
+ return m_clientLocation.x().toInt();
}
int MouseRelatedEvent::y() const
{
// FIXME: This is not correct.
// See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>.
- return m_clientLocation.y();
+ return m_clientLocation.y().toInt();
}
DEFINE_TRACE(MouseRelatedEvent)
« no previous file with comments | « third_party/WebKit/Source/core/events/MouseRelatedEvent.h ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698