| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 if (!event->view() || !event->view()->isLocalDOMWindow()) | 131 if (!event->view() || !event->view()->isLocalDOMWindow()) |
| 132 return 1; | 132 return 1; |
| 133 LocalFrame* frame = toLocalDOMWindow(event->view())->frame(); | 133 LocalFrame* frame = toLocalDOMWindow(event->view())->frame(); |
| 134 if (!frame) | 134 if (!frame) |
| 135 return 1; | 135 return 1; |
| 136 return frame->pageZoomFactor(); | 136 return frame->pageZoomFactor(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void MouseRelatedEvent::computePageLocation() { | 139 void MouseRelatedEvent::computePageLocation() { |
| 140 float scaleFactor = pageZoomFactor(this); | 140 float scaleFactor = pageZoomFactor(this); |
| 141 setAbsoluteLocation(roundedLayoutPoint( | 141 setAbsoluteLocation( |
| 142 FloatPoint(pageX() * scaleFactor, pageY() * scaleFactor))); | 142 LayoutPoint(FloatPoint(pageX() * scaleFactor, pageY() * scaleFactor))); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void MouseRelatedEvent::receivedTarget() { | 145 void MouseRelatedEvent::receivedTarget() { |
| 146 m_hasCachedRelativePosition = false; | 146 m_hasCachedRelativePosition = false; |
| 147 } | 147 } |
| 148 | 148 |
| 149 static const LayoutObject* findTargetLayoutObject(Node*& targetNode) { | 149 static const LayoutObject* findTargetLayoutObject(Node*& targetNode) { |
| 150 LayoutObject* layoutObject = targetNode->layoutObject(); | 150 LayoutObject* layoutObject = targetNode->layoutObject(); |
| 151 if (!layoutObject || !layoutObject->isSVG()) | 151 if (!layoutObject || !layoutObject->isSVG()) |
| 152 return layoutObject; | 152 return layoutObject; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 180 | 180 |
| 181 // Adding this here to address crbug.com/570666. Basically we'd like to | 181 // Adding this here to address crbug.com/570666. Basically we'd like to |
| 182 // find the local coordinates relative to the padding box not the border | 182 // find the local coordinates relative to the padding box not the border |
| 183 // box. | 183 // box. |
| 184 if (layoutObject->isBoxModelObject()) { | 184 if (layoutObject->isBoxModelObject()) { |
| 185 const LayoutBoxModelObject* layoutBox = | 185 const LayoutBoxModelObject* layoutBox = |
| 186 toLayoutBoxModelObject(layoutObject); | 186 toLayoutBoxModelObject(layoutObject); |
| 187 localPos.move(-layoutBox->borderLeft(), -layoutBox->borderTop()); | 187 localPos.move(-layoutBox->borderLeft(), -layoutBox->borderTop()); |
| 188 } | 188 } |
| 189 | 189 |
| 190 m_offsetLocation = roundedLayoutPoint(localPos); | 190 m_offsetLocation = LayoutPoint(localPos); |
| 191 float scaleFactor = 1 / pageZoomFactor(this); | 191 float scaleFactor = 1 / pageZoomFactor(this); |
| 192 if (scaleFactor != 1.0f) | 192 if (scaleFactor != 1.0f) |
| 193 m_offsetLocation.scale(scaleFactor, scaleFactor); | 193 m_offsetLocation.scale(scaleFactor, scaleFactor); |
| 194 } | 194 } |
| 195 | 195 |
| 196 // Adjust layerLocation to be relative to the layer. | 196 // Adjust layerLocation to be relative to the layer. |
| 197 // FIXME: event.layerX and event.layerY are poorly defined, | 197 // FIXME: event.layerX and event.layerY are poorly defined, |
| 198 // and probably don't always correspond to PaintLayer offsets. | 198 // and probably don't always correspond to PaintLayer offsets. |
| 199 // https://bugs.webkit.org/show_bug.cgi?id=21868 | 199 // https://bugs.webkit.org/show_bug.cgi?id=21868 |
| 200 Node* n = targetNode; | 200 Node* n = targetNode; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // See Microsoft documentation and | 259 // See Microsoft documentation and |
| 260 // <http://www.quirksmode.org/dom/w3c_events.html>. | 260 // <http://www.quirksmode.org/dom/w3c_events.html>. |
| 261 return m_clientLocation.y().toInt(); | 261 return m_clientLocation.y().toInt(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 DEFINE_TRACE(MouseRelatedEvent) { | 264 DEFINE_TRACE(MouseRelatedEvent) { |
| 265 UIEventWithKeyState::trace(visitor); | 265 UIEventWithKeyState::trace(visitor); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace blink | 268 } // namespace blink |
| OLD | NEW |