| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const LayoutObject* findTargetLayoutObject(Node*& targetNode) { | 65 const LayoutObject* findTargetLayoutObject(Node*& targetNode) { |
| 66 LayoutObject* layoutObject = targetNode->layoutObject(); | 66 LayoutObject* layoutObject = targetNode->layoutObject(); |
| 67 if (!layoutObject || !layoutObject->isSVG()) | 67 if (!layoutObject || !layoutObject->isSVG()) |
| 68 return layoutObject; | 68 return layoutObject; |
| 69 // If this is an SVG node, compute the offset to the padding box of the | 69 // If this is an SVG node, compute the offset to the padding box of the |
| 70 // outermost SVG root (== the closest ancestor that has a CSS layout box.) | 70 // outermost SVG root (== the closest ancestor that has a CSS layout box.) |
| 71 while (!layoutObject->isSVGRoot()) | 71 while (!layoutObject->isSVGRoot()) |
| 72 layoutObject = layoutObject->parent(); | 72 layoutObject = layoutObject->parent(); |
| 73 // Update the target node to point to the SVG root. | 73 // Update the target node to point to the SVG root. |
| 74 targetNode = layoutObject->node(); | 74 targetNode = layoutObject->node(); |
| 75 DCHECK(!targetNode || (targetNode->isSVGElement() && | 75 DCHECK(!targetNode || |
| 76 toSVGElement(*targetNode).isOutermostSVGSVGElement())); | 76 (targetNode->isSVGElement() && |
| 77 toSVGElement(*targetNode).isOutermostSVGSVGElement())); |
| 77 return layoutObject; | 78 return layoutObject; |
| 78 } | 79 } |
| 79 | 80 |
| 80 } // namespace | 81 } // namespace |
| 81 | 82 |
| 82 MouseEvent* MouseEvent::create(ScriptState* scriptState, | 83 MouseEvent* MouseEvent::create(ScriptState* scriptState, |
| 83 const AtomicString& type, | 84 const AtomicString& type, |
| 84 const MouseEventInit& initializer) { | 85 const MouseEventInit& initializer) { |
| 85 if (scriptState && scriptState->world().isIsolatedWorld()) | 86 if (scriptState && scriptState->world().isIsolatedWorld()) |
| 86 UIEventWithKeyState::didCreateEventInIsolatedWorld( | 87 UIEventWithKeyState::didCreateEventInIsolatedWorld( |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 563 |
| 563 int MouseEvent::offsetY() { | 564 int MouseEvent::offsetY() { |
| 564 if (!hasPosition()) | 565 if (!hasPosition()) |
| 565 return 0; | 566 return 0; |
| 566 if (!m_hasCachedRelativePosition) | 567 if (!m_hasCachedRelativePosition) |
| 567 computeRelativePosition(); | 568 computeRelativePosition(); |
| 568 return std::round(m_offsetLocation.y()); | 569 return std::round(m_offsetLocation.y()); |
| 569 } | 570 } |
| 570 | 571 |
| 571 } // namespace blink | 572 } // namespace blink |
| OLD | NEW |