OLD | NEW |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 cancelable, | 67 cancelable, |
68 abstractView, | 68 abstractView, |
69 detail, | 69 detail, |
70 modifiers, | 70 modifiers, |
71 platformTimeStamp, | 71 platformTimeStamp, |
72 sourceCapabilities), | 72 sourceCapabilities), |
73 m_screenLocation(screenLocation), | 73 m_screenLocation(screenLocation), |
74 m_movementDelta(movementDelta), | 74 m_movementDelta(movementDelta), |
75 m_positionType(positionType) { | 75 m_positionType(positionType) { |
76 LayoutPoint adjustedPageLocation; | 76 LayoutPoint adjustedPageLocation; |
77 LayoutPoint scrollPosition; | 77 LayoutSize scrollOffset; |
78 | 78 |
79 LocalFrame* frame = view() && view()->isLocalDOMWindow() | 79 LocalFrame* frame = view() && view()->isLocalDOMWindow() |
80 ? toLocalDOMWindow(view())->frame() | 80 ? toLocalDOMWindow(view())->frame() |
81 : nullptr; | 81 : nullptr; |
82 if (frame && hasPosition()) { | 82 if (frame && hasPosition()) { |
83 if (FrameView* frameView = frame->view()) { | 83 if (FrameView* frameView = frame->view()) { |
84 scrollPosition = frameView->scrollPosition(); | 84 scrollOffset = LayoutSize(frameView->scrollOffsetInt()); |
85 adjustedPageLocation = frameView->rootFrameToContents(rootFrameLocation); | 85 adjustedPageLocation = frameView->rootFrameToContents(rootFrameLocation); |
86 float scaleFactor = 1 / frame->pageZoomFactor(); | 86 float scaleFactor = 1 / frame->pageZoomFactor(); |
87 if (scaleFactor != 1.0f) { | 87 if (scaleFactor != 1.0f) { |
88 adjustedPageLocation.scale(scaleFactor, scaleFactor); | 88 adjustedPageLocation.scale(scaleFactor, scaleFactor); |
89 scrollPosition.scale(scaleFactor, scaleFactor); | 89 scrollOffset.scale(scaleFactor, scaleFactor); |
90 } | 90 } |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 m_clientLocation = adjustedPageLocation - toLayoutSize(scrollPosition); | 94 m_clientLocation = adjustedPageLocation - scrollOffset; |
95 m_pageLocation = adjustedPageLocation; | 95 m_pageLocation = adjustedPageLocation; |
96 | 96 |
97 // Set up initial values for coordinates. | 97 // Set up initial values for coordinates. |
98 // Correct values are computed lazily, see computeRelativePosition. | 98 // Correct values are computed lazily, see computeRelativePosition. |
99 m_layerLocation = m_pageLocation; | 99 m_layerLocation = m_pageLocation; |
100 m_offsetLocation = m_pageLocation; | 100 m_offsetLocation = m_pageLocation; |
101 | 101 |
102 computePageLocation(); | 102 computePageLocation(); |
103 m_hasCachedRelativePosition = false; | 103 m_hasCachedRelativePosition = false; |
104 } | 104 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // See Microsoft documentation and | 258 // See Microsoft documentation and |
259 // <http://www.quirksmode.org/dom/w3c_events.html>. | 259 // <http://www.quirksmode.org/dom/w3c_events.html>. |
260 return m_clientLocation.y().toInt(); | 260 return m_clientLocation.y().toInt(); |
261 } | 261 } |
262 | 262 |
263 DEFINE_TRACE(MouseRelatedEvent) { | 263 DEFINE_TRACE(MouseRelatedEvent) { |
264 UIEventWithKeyState::trace(visitor); | 264 UIEventWithKeyState::trace(visitor); |
265 } | 265 } |
266 | 266 |
267 } // namespace blink | 267 } // namespace blink |
OLD | NEW |