darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 1 | /* |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 2 | * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 | * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 | * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
benjamin@webkit.org | ac28bde | 2013-06-19 22:41:17 +0000 | [diff] [blame] | 5 | * Copyright (C) 2003, 2005, 2006, 2008, 2013 Apple Inc. All rights reserved. |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Library General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Library General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Library General Public License |
| 18 | * along with this library; see the file COPYING.LIB. If not, write to |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 19 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 | * Boston, MA 02110-1301, USA. |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 21 | */ |
| 22 | |
| 23 | #include "config.h" |
| 24 | #include "MouseRelatedEvent.h" |
| 25 | |
rniwa@webkit.org | f8614f7 | 2018-05-04 23:52:43 +0000 | [diff] [blame] | 26 | #include "DOMWindow.h" |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 27 | #include "Document.h" |
darin | 8ce13dc | 2006-06-26 16:38:55 +0000 | [diff] [blame] | 28 | #include "Frame.h" |
darin | 647be15 | 2006-11-05 22:02:23 +0000 | [diff] [blame] | 29 | #include "FrameView.h" |
megan_gardner@apple.com | ea94f53 | 2017-07-10 19:46:01 +0000 | [diff] [blame] | 30 | #include "LayoutPoint.h" |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 31 | #include "RenderLayer.h" |
| 32 | #include "RenderObject.h" |
ysuzuki@apple.com | e407070 | 2019-09-18 22:10:00 +0000 | [diff] [blame] | 33 | #include <wtf/IsoMallocInlines.h> |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 34 | |
| 35 | namespace WebCore { |
| 36 | |
ysuzuki@apple.com | e407070 | 2019-09-18 22:10:00 +0000 | [diff] [blame] | 37 | WTF_MAKE_ISO_ALLOCATED_IMPL(MouseRelatedEvent); |
| 38 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 39 | MouseRelatedEvent::MouseRelatedEvent(const AtomString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, |
rniwa@webkit.org | 1321fa3 | 2018-08-24 20:14:50 +0000 | [diff] [blame] | 40 | MonotonicTime timestamp, RefPtr<WindowProxy>&& view, int detail, |
rniwa@webkit.org | dc499bd | 2018-08-24 22:51:33 +0000 | [diff] [blame] | 41 | const IntPoint& screenLocation, const IntPoint& windowLocation, const IntPoint& movementDelta, OptionSet<Modifier> modifiers, IsSimulated isSimulated, IsTrusted isTrusted) |
| 42 | : UIEventWithKeyState(eventType, canBubble, isCancelable, isComposed, timestamp, WTFMove(view), detail, modifiers, isTrusted) |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 43 | , m_screenLocation(screenLocation) |
scheib@chromium.org | e972c2e | 2011-11-24 00:25:38 +0000 | [diff] [blame] | 44 | #if ENABLE(POINTER_LOCK) |
| 45 | , m_movementDelta(movementDelta) |
| 46 | #endif |
rniwa@webkit.org | 2646465 | 2018-08-22 04:41:06 +0000 | [diff] [blame] | 47 | , m_isSimulated(isSimulated == IsSimulated::Yes) |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 48 | { |
rniwa@webkit.org | 2646465 | 2018-08-22 04:41:06 +0000 | [diff] [blame] | 49 | #if !ENABLE(POINTER_LOCK) |
| 50 | UNUSED_PARAM(movementDelta); |
| 51 | #endif |
| 52 | init(m_isSimulated, windowLocation); |
| 53 | } |
| 54 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 55 | MouseRelatedEvent::MouseRelatedEvent(const AtomString& type, IsCancelable isCancelable, MonotonicTime timestamp, RefPtr<WindowProxy>&& view, const IntPoint& globalLocation, OptionSet<Modifier> modifiers) |
rniwa@webkit.org | 1321fa3 | 2018-08-24 20:14:50 +0000 | [diff] [blame] | 56 | : MouseRelatedEvent(type, CanBubble::Yes, isCancelable, IsComposed::Yes, timestamp, |
| 57 | WTFMove(view), 0, globalLocation, globalLocation /* Converted in init */, { }, modifiers, IsSimulated::No) |
rniwa@webkit.org | 2646465 | 2018-08-22 04:41:06 +0000 | [diff] [blame] | 58 | { |
jiewen_tan@apple.com | cb979e9 | 2016-02-11 00:03:11 +0000 | [diff] [blame] | 59 | } |
| 60 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 61 | MouseRelatedEvent::MouseRelatedEvent(const AtomString& eventType, const MouseRelatedEventInit& initializer, IsTrusted isTrusted) |
rniwa@webkit.org | 1321fa3 | 2018-08-24 20:14:50 +0000 | [diff] [blame] | 62 | : UIEventWithKeyState(eventType, initializer) |
jiewen_tan@apple.com | cb979e9 | 2016-02-11 00:03:11 +0000 | [diff] [blame] | 63 | , m_screenLocation(IntPoint(initializer.screenX, initializer.screenY)) |
| 64 | #if ENABLE(POINTER_LOCK) |
| 65 | , m_movementDelta(IntPoint(0, 0)) |
| 66 | #endif |
jiewen_tan@apple.com | cb979e9 | 2016-02-11 00:03:11 +0000 | [diff] [blame] | 67 | { |
rniwa@webkit.org | 1321fa3 | 2018-08-24 20:14:50 +0000 | [diff] [blame] | 68 | ASSERT_UNUSED(isTrusted, isTrusted == IsTrusted::No); |
jiewen_tan@apple.com | cb979e9 | 2016-02-11 00:03:11 +0000 | [diff] [blame] | 69 | init(false, IntPoint(0, 0)); |
| 70 | } |
| 71 | |
| 72 | void MouseRelatedEvent::init(bool isSimulated, const IntPoint& windowLocation) |
| 73 | { |
simon.fraser@apple.com | de89f4d | 2017-06-30 02:09:09 +0000 | [diff] [blame] | 74 | if (!isSimulated) { |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 75 | if (auto* frameView = frameViewFromWindowProxy(view())) { |
simon.fraser@apple.com | ba0535e | 2017-05-13 18:24:15 +0000 | [diff] [blame] | 76 | FloatPoint absolutePoint = frameView->windowToContents(windowLocation); |
| 77 | FloatPoint documentPoint = frameView->absoluteToDocumentPoint(absolutePoint); |
| 78 | m_pageLocation = flooredLayoutPoint(documentPoint); |
simon.fraser@apple.com | 5cdcc94 | 2017-07-17 20:24:16 +0000 | [diff] [blame] | 79 | m_clientLocation = pagePointToClientPoint(m_pageLocation, frameView); |
dglazkov@chromium.org | 3beb6ec | 2011-03-31 16:01:13 +0000 | [diff] [blame] | 80 | } |
| 81 | } |
| 82 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 83 | initCoordinates(); |
| 84 | } |
| 85 | |
| 86 | void MouseRelatedEvent::initCoordinates() |
| 87 | { |
| 88 | // Set up initial values for coordinates. |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 89 | // Correct values are computed lazily, see computeRelativePosition. |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 90 | m_layerLocation = m_pageLocation; |
| 91 | m_offsetLocation = m_pageLocation; |
simon.fraser@apple.com | 032683d | 2009-03-22 17:35:38 +0000 | [diff] [blame] | 92 | |
| 93 | computePageLocation(); |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 94 | m_hasCachedRelativePosition = false; |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 95 | } |
| 96 | |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 97 | FrameView* MouseRelatedEvent::frameViewFromWindowProxy(WindowProxy* windowProxy) |
simon.fraser@apple.com | 5cdcc94 | 2017-07-17 20:24:16 +0000 | [diff] [blame] | 98 | { |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 99 | if (!windowProxy || !is<DOMWindow>(windowProxy->window())) |
simon.fraser@apple.com | 5cdcc94 | 2017-07-17 20:24:16 +0000 | [diff] [blame] | 100 | return nullptr; |
| 101 | |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 102 | auto* frame = downcast<DOMWindow>(*windowProxy->window()).frame(); |
| 103 | return frame ? frame->view() : nullptr; |
simon.fraser@apple.com | 5cdcc94 | 2017-07-17 20:24:16 +0000 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | LayoutPoint MouseRelatedEvent::pagePointToClientPoint(LayoutPoint pagePoint, FrameView* frameView) |
| 107 | { |
| 108 | if (!frameView) |
| 109 | return pagePoint; |
| 110 | |
| 111 | return flooredLayoutPoint(frameView->documentToClientPoint(pagePoint)); |
| 112 | } |
| 113 | |
| 114 | LayoutPoint MouseRelatedEvent::pagePointToAbsolutePoint(LayoutPoint pagePoint, FrameView* frameView) |
| 115 | { |
| 116 | if (!frameView) |
| 117 | return pagePoint; |
| 118 | |
| 119 | return pagePoint.scaled(frameView->documentToAbsoluteScaleFactor()); |
| 120 | } |
| 121 | |
eae@chromium.org | 61ebe43 | 2011-08-15 19:31:06 +0000 | [diff] [blame] | 122 | void MouseRelatedEvent::initCoordinates(const LayoutPoint& clientLocation) |
darin | 896f671 | 2006-06-28 03:52:29 +0000 | [diff] [blame] | 123 | { |
| 124 | // Set up initial values for coordinates. |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 125 | // Correct values are computed lazily, see computeRelativePosition. |
simon.fraser@apple.com | ba0535e | 2017-05-13 18:24:15 +0000 | [diff] [blame] | 126 | FloatSize documentToClientOffset; |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 127 | if (auto* frameView = frameViewFromWindowProxy(view())) |
simon.fraser@apple.com | de89f4d | 2017-06-30 02:09:09 +0000 | [diff] [blame] | 128 | documentToClientOffset = frameView->documentToClientOffset(); |
simon.fraser@apple.com | ba0535e | 2017-05-13 18:24:15 +0000 | [diff] [blame] | 129 | |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 130 | m_clientLocation = clientLocation; |
simon.fraser@apple.com | ba0535e | 2017-05-13 18:24:15 +0000 | [diff] [blame] | 131 | m_pageLocation = clientLocation - LayoutSize(documentToClientOffset); |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 132 | |
| 133 | m_layerLocation = m_pageLocation; |
| 134 | m_offsetLocation = m_pageLocation; |
simon.fraser@apple.com | 032683d | 2009-03-22 17:35:38 +0000 | [diff] [blame] | 135 | |
| 136 | computePageLocation(); |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 137 | m_hasCachedRelativePosition = false; |
simon.fraser@apple.com | 032683d | 2009-03-22 17:35:38 +0000 | [diff] [blame] | 138 | } |
| 139 | |
simon.fraser@apple.com | de89f4d | 2017-06-30 02:09:09 +0000 | [diff] [blame] | 140 | float MouseRelatedEvent::documentToAbsoluteScaleFactor() const |
jknotten@chromium.org | 664f04f | 2011-10-06 10:10:07 +0000 | [diff] [blame] | 141 | { |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 142 | if (auto* frameView = frameViewFromWindowProxy(view())) |
simon.fraser@apple.com | de89f4d | 2017-06-30 02:09:09 +0000 | [diff] [blame] | 143 | return frameView->documentToAbsoluteScaleFactor(); |
| 144 | |
| 145 | return 1; |
jknotten@chromium.org | 664f04f | 2011-10-06 10:10:07 +0000 | [diff] [blame] | 146 | } |
| 147 | |
simon.fraser@apple.com | 032683d | 2009-03-22 17:35:38 +0000 | [diff] [blame] | 148 | void MouseRelatedEvent::computePageLocation() |
| 149 | { |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 150 | m_absoluteLocation = pagePointToAbsolutePoint(m_pageLocation, frameViewFromWindowProxy(view())); |
darin | 896f671 | 2006-06-28 03:52:29 +0000 | [diff] [blame] | 151 | } |
| 152 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 153 | void MouseRelatedEvent::receivedTarget() |
| 154 | { |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 155 | m_hasCachedRelativePosition = false; |
| 156 | } |
| 157 | |
| 158 | void MouseRelatedEvent::computeRelativePosition() |
| 159 | { |
darin@apple.com | 17cae1e | 2017-11-13 06:12:09 +0000 | [diff] [blame] | 160 | if (!is<Node>(target())) |
ap | 5f8a6da | 2006-12-15 21:49:43 +0000 | [diff] [blame] | 161 | return; |
darin@apple.com | 17cae1e | 2017-11-13 06:12:09 +0000 | [diff] [blame] | 162 | auto& targetNode = downcast<Node>(*target()); |
ap | 5f8a6da | 2006-12-15 21:49:43 +0000 | [diff] [blame] | 163 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 164 | // Compute coordinates that are based on the target. |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 165 | m_layerLocation = m_pageLocation; |
| 166 | m_offsetLocation = m_pageLocation; |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 167 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 168 | // Must have an updated render tree for this math to work correctly. |
darin@apple.com | 17cae1e | 2017-11-13 06:12:09 +0000 | [diff] [blame] | 169 | targetNode.document().updateLayoutIgnorePendingStylesheets(); |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 170 | |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 171 | // Adjust offsetLocation to be relative to the target's position. |
darin@apple.com | 17cae1e | 2017-11-13 06:12:09 +0000 | [diff] [blame] | 172 | if (RenderObject* r = targetNode.renderer()) { |
zalan@apple.com | 83de8f8 | 2014-08-26 02:11:44 +0000 | [diff] [blame] | 173 | m_offsetLocation = LayoutPoint(r->absoluteToLocal(absoluteLocation(), UseTransforms)); |
simon.fraser@apple.com | de89f4d | 2017-06-30 02:09:09 +0000 | [diff] [blame] | 174 | float scaleFactor = 1 / documentToAbsoluteScaleFactor(); |
jonlee@apple.com | b8f98c3 | 2012-11-18 08:03:31 +0000 | [diff] [blame] | 175 | if (scaleFactor != 1.0f) |
simon.fraser@apple.com | 0b353f3 | 2016-11-04 05:11:12 +0000 | [diff] [blame] | 176 | m_offsetLocation.scale(scaleFactor); |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 177 | } |
| 178 | |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 179 | // Adjust layerLocation to be relative to the layer. |
simon.fraser@apple.com | 6a7e0c8 | 2012-11-30 23:00:41 +0000 | [diff] [blame] | 180 | // FIXME: event.layerX and event.layerY are poorly defined, |
| 181 | // and probably don't always correspond to RenderLayer offsets. |
| 182 | // https://bugs.webkit.org/show_bug.cgi?id=21868 |
darin@apple.com | 17cae1e | 2017-11-13 06:12:09 +0000 | [diff] [blame] | 183 | Node* n = &targetNode; |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 184 | while (n && !n->renderer()) |
dglazkov@chromium.org | e43caa7 | 2010-11-18 00:20:10 +0000 | [diff] [blame] | 185 | n = n->parentNode(); |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 186 | |
| 187 | RenderLayer* layer; |
| 188 | if (n && (layer = n->renderer()->enclosingLayer())) { |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 189 | for (; layer; layer = layer->parent()) { |
eae@chromium.org | fc240a2 | 2011-11-02 00:08:04 +0000 | [diff] [blame] | 190 | m_layerLocation -= toLayoutSize(layer->location()); |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 191 | } |
| 192 | } |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 193 | |
| 194 | m_hasCachedRelativePosition = true; |
| 195 | } |
megan_gardner@apple.com | ea94f53 | 2017-07-10 19:46:01 +0000 | [diff] [blame] | 196 | |
| 197 | FloatPoint MouseRelatedEvent::locationInRootViewCoordinates() const |
| 198 | { |
cdumez@apple.com | 240d017 | 2018-04-27 22:11:00 +0000 | [diff] [blame] | 199 | if (auto* frameView = frameViewFromWindowProxy(view())) |
simon.fraser@apple.com | 5cdcc94 | 2017-07-17 20:24:16 +0000 | [diff] [blame] | 200 | return frameView->contentsToRootView(roundedIntPoint(m_absoluteLocation)); |
| 201 | |
| 202 | return m_absoluteLocation; |
megan_gardner@apple.com | ea94f53 | 2017-07-10 19:46:01 +0000 | [diff] [blame] | 203 | } |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 204 | |
| 205 | int MouseRelatedEvent::layerX() |
| 206 | { |
| 207 | if (!m_hasCachedRelativePosition) |
| 208 | computeRelativePosition(); |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 209 | return m_layerLocation.x(); |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | int MouseRelatedEvent::layerY() |
| 213 | { |
| 214 | if (!m_hasCachedRelativePosition) |
| 215 | computeRelativePosition(); |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 216 | return m_layerLocation.y(); |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | int MouseRelatedEvent::offsetX() |
| 220 | { |
akling@apple.com | bc74c64 | 2014-02-28 18:44:10 +0000 | [diff] [blame] | 221 | if (isSimulated()) |
| 222 | return 0; |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 223 | if (!m_hasCachedRelativePosition) |
| 224 | computeRelativePosition(); |
leviw@chromium.org | 0e23061 | 2012-03-01 19:33:44 +0000 | [diff] [blame] | 225 | return roundToInt(m_offsetLocation.x()); |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | int MouseRelatedEvent::offsetY() |
| 229 | { |
akling@apple.com | bc74c64 | 2014-02-28 18:44:10 +0000 | [diff] [blame] | 230 | if (isSimulated()) |
| 231 | return 0; |
eae@chromium.org | 198fc13 | 2011-03-29 11:02:33 +0000 | [diff] [blame] | 232 | if (!m_hasCachedRelativePosition) |
| 233 | computeRelativePosition(); |
leviw@chromium.org | 0e23061 | 2012-03-01 19:33:44 +0000 | [diff] [blame] | 234 | return roundToInt(m_offsetLocation.y()); |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | int MouseRelatedEvent::pageX() const |
| 238 | { |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 239 | return m_pageLocation.x(); |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | int MouseRelatedEvent::pageY() const |
| 243 | { |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 244 | return m_pageLocation.y(); |
| 245 | } |
| 246 | |
eae@chromium.org | 61ebe43 | 2011-08-15 19:31:06 +0000 | [diff] [blame] | 247 | const LayoutPoint& MouseRelatedEvent::pageLocation() const |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 248 | { |
| 249 | return m_pageLocation; |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | int MouseRelatedEvent::x() const |
| 253 | { |
| 254 | // FIXME: This is not correct. |
| 255 | // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>. |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 256 | return m_clientLocation.x(); |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | int MouseRelatedEvent::y() const |
| 260 | { |
| 261 | // FIXME: This is not correct. |
| 262 | // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events.html>. |
eae@chromium.org | 039e826 | 2011-06-01 23:19:02 +0000 | [diff] [blame] | 263 | return m_clientLocation.y(); |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 264 | } |
| 265 | |
| 266 | } // namespace WebCore |