| 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 30 matching lines...) Expand all Loading... |
| 41 MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubb
le, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> abstractView, | 41 MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubb
le, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> abstractView, |
| 42 int detail, const IntPoint& screenLocation,
const IntPoint& windowLocation, | 42 int detail, const IntPoint& screenLocation,
const IntPoint& windowLocation, |
| 43 const IntPoint& movementDelta, | 43 const IntPoint& movementDelta, |
| 44 bool ctrlKey, bool altKey, bool shiftKey, b
ool metaKey, bool isSimulated) | 44 bool ctrlKey, bool altKey, bool shiftKey, b
ool metaKey, bool isSimulated) |
| 45 : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail
, ctrlKey, altKey, shiftKey, metaKey) | 45 : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail
, ctrlKey, altKey, shiftKey, metaKey) |
| 46 , m_screenLocation(screenLocation) | 46 , m_screenLocation(screenLocation) |
| 47 , m_movementDelta(movementDelta) | 47 , m_movementDelta(movementDelta) |
| 48 , m_isSimulated(isSimulated) | 48 , m_isSimulated(isSimulated) |
| 49 { | 49 { |
| 50 LayoutPoint adjustedPageLocation; | 50 LayoutPoint adjustedPageLocation; |
| 51 LayoutPoint scrollPosition; | |
| 52 | 51 |
| 53 LocalFrame* frame = view() ? view()->frame() : 0; | 52 LocalFrame* frame = view() ? view()->frame() : 0; |
| 54 if (frame && !isSimulated) { | 53 if (frame && !isSimulated) { |
| 55 if (FrameView* frameView = frame->view()) { | 54 if (FrameView* frameView = frame->view()) { |
| 56 scrollPosition = frameView->scrollPosition(); | |
| 57 adjustedPageLocation = frameView->windowToContents(windowLocation); | 55 adjustedPageLocation = frameView->windowToContents(windowLocation); |
| 58 float scaleFactor = 1 / frame->pageZoomFactor(); | 56 float scaleFactor = 1 / frame->pageZoomFactor(); |
| 59 if (scaleFactor != 1.0f) { | 57 if (scaleFactor != 1.0f) { |
| 60 adjustedPageLocation.scale(scaleFactor, scaleFactor); | 58 adjustedPageLocation.scale(scaleFactor, scaleFactor); |
| 61 scrollPosition.scale(scaleFactor, scaleFactor); | |
| 62 } | 59 } |
| 63 } | 60 } |
| 64 } | 61 } |
| 65 | 62 |
| 66 m_clientLocation = adjustedPageLocation - toLayoutSize(scrollPosition); | 63 m_clientLocation = adjustedPageLocation; |
| 67 m_pageLocation = adjustedPageLocation; | 64 m_pageLocation = adjustedPageLocation; |
| 68 | 65 |
| 69 initCoordinates(); | 66 initCoordinates(); |
| 70 } | 67 } |
| 71 | 68 |
| 72 void MouseRelatedEvent::initCoordinates() | 69 void MouseRelatedEvent::initCoordinates() |
| 73 { | 70 { |
| 74 // Set up initial values for coordinates. | 71 // Set up initial values for coordinates. |
| 75 // Correct values are computed lazily, see computeRelativePosition. | 72 // Correct values are computed lazily, see computeRelativePosition. |
| 76 m_layerLocation = m_pageLocation; | 73 m_layerLocation = m_pageLocation; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events
.html>. | 208 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events
.html>. |
| 212 return m_clientLocation.y(); | 209 return m_clientLocation.y(); |
| 213 } | 210 } |
| 214 | 211 |
| 215 void MouseRelatedEvent::trace(Visitor* visitor) | 212 void MouseRelatedEvent::trace(Visitor* visitor) |
| 216 { | 213 { |
| 217 UIEventWithKeyState::trace(visitor); | 214 UIEventWithKeyState::trace(visitor); |
| 218 } | 215 } |
| 219 | 216 |
| 220 } // namespace blink | 217 } // namespace blink |
| OLD | NEW |