| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 { | 136 { |
| 137 Node* targetNode = target() ? target()->toNode() : nullptr; | 137 Node* targetNode = target() ? target()->toNode() : nullptr; |
| 138 if (!targetNode) | 138 if (!targetNode) |
| 139 return; | 139 return; |
| 140 | 140 |
| 141 // Compute coordinates that are based on the target. | 141 // Compute coordinates that are based on the target. |
| 142 m_layerLocation = m_pageLocation; | 142 m_layerLocation = m_pageLocation; |
| 143 m_offsetLocation = m_pageLocation; | 143 m_offsetLocation = m_pageLocation; |
| 144 | 144 |
| 145 // Must have an updated layout tree for this math to work correctly. | 145 // Must have an updated layout tree for this math to work correctly. |
| 146 targetNode->document().updateLayoutIgnorePendingStylesheets(); | 146 targetNode->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 147 | 147 |
| 148 // Adjust offsetLocation to be relative to the target's padding box. | 148 // Adjust offsetLocation to be relative to the target's padding box. |
| 149 if (LayoutObject* r = targetNode->layoutObject()) { | 149 if (LayoutObject* r = targetNode->layoutObject()) { |
| 150 FloatPoint localPos = r->absoluteToLocal(FloatPoint(absoluteLocation()),
UseTransforms); | 150 FloatPoint localPos = r->absoluteToLocal(FloatPoint(absoluteLocation()),
UseTransforms); |
| 151 | 151 |
| 152 // Adding this here to address crbug.com/570666. Basically we'd like to | 152 // Adding this here to address crbug.com/570666. Basically we'd like to |
| 153 // find the local coordinates relative to the padding box not the border
box. | 153 // find the local coordinates relative to the padding box not the border
box. |
| 154 if (r->isBoxModelObject()) { | 154 if (r->isBoxModelObject()) { |
| 155 LayoutBoxModelObject* layoutBox = toLayoutBoxModelObject(r); | 155 LayoutBoxModelObject* layoutBox = toLayoutBoxModelObject(r); |
| 156 localPos.move(-layoutBox->borderLeft(), -layoutBox->borderTop()); | 156 localPos.move(-layoutBox->borderLeft(), -layoutBox->borderTop()); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events
.html>. | 234 // See Microsoft documentation and <http://www.quirksmode.org/dom/w3c_events
.html>. |
| 235 return m_clientLocation.y(); | 235 return m_clientLocation.y(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 DEFINE_TRACE(MouseRelatedEvent) | 238 DEFINE_TRACE(MouseRelatedEvent) |
| 239 { | 239 { |
| 240 UIEventWithKeyState::trace(visitor); | 240 UIEventWithKeyState::trace(visitor); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace blink | 243 } // namespace blink |
| OLD | NEW |