Chromium Code Reviews| Index: third_party/WebKit/Source/core/events/MouseRelatedEvent.h |
| diff --git a/third_party/WebKit/Source/core/events/MouseRelatedEvent.h b/third_party/WebKit/Source/core/events/MouseRelatedEvent.h |
| index 6d90d75eaf845aba5b91e226656c5d2798e6d6e9..ac3d2cf5847780f931f3bcafd0b53fb4299d68ae 100644 |
| --- a/third_party/WebKit/Source/core/events/MouseRelatedEvent.h |
| +++ b/third_party/WebKit/Source/core/events/MouseRelatedEvent.h |
| @@ -43,14 +43,24 @@ class CORE_EXPORT MouseRelatedEvent : public UIEventWithKeyState { |
| }; |
| // Note that these values are adjusted to counter the effects of zoom, so that |
| // values exposed via DOM APIs are invariant under zooming. |
| - int screenX() const { return m_screenLocation.x(); } |
| - int screenY() const { return m_screenLocation.y(); } |
| - const IntPoint& screenLocation() const { return m_screenLocation; } |
| - int clientX() const { return m_clientLocation.x().toInt(); } |
| - int clientY() const { return m_clientLocation.y().toInt(); } |
| + double screenX() const { |
| + return isPointerEvent() ? m_screenLocation.x().toDouble() |
|
Rick Byers
2016/10/12 14:09:54
It seems odd that this pattern of conditional retu
mustaq
2016/10/12 16:00:01
The problem here is that the initialization is don
|
| + : m_screenLocation.x().toInt(); |
| + } |
| + double screenY() const { |
| + return isPointerEvent() ? m_screenLocation.y().toDouble() |
| + : m_screenLocation.y().toInt(); |
| + } |
| + double clientX() const { |
| + return isPointerEvent() ? m_clientLocation.x().toDouble() |
| + : m_clientLocation.x().toInt(); |
| + } |
| + double clientY() const { |
| + return isPointerEvent() ? m_clientLocation.y().toDouble() |
| + : m_clientLocation.y().toInt(); |
| + } |
| int movementX() const { return m_movementDelta.x().toInt(); } |
| int movementY() const { return m_movementDelta.y().toInt(); } |
| - const LayoutPoint& clientLocation() const { return m_clientLocation; } |
| int layerX(); |
| int layerY(); |
| int offsetX(); |
| @@ -90,14 +100,14 @@ class CORE_EXPORT MouseRelatedEvent : public UIEventWithKeyState { |
| MouseRelatedEvent(const AtomicString& type, |
| const MouseEventInit& initializer); |
| - void initCoordinates(const LayoutPoint& clientLocation); |
| + void initCoordinates(const double clientX, const double clientY); |
| void receivedTarget() final; |
| void computePageLocation(); |
| void computeRelativePosition(); |
| // Expose these so MouseEvent::initMouseEvent can set them. |
| - IntPoint m_screenLocation; |
| + LayoutPoint m_screenLocation; |
| LayoutPoint m_clientLocation; |
| LayoutPoint m_movementDelta; |