OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 m_scrollbar = other.scrollbar(); | 106 m_scrollbar = other.scrollbar(); |
107 m_isFirstLetter = other.m_isFirstLetter; | 107 m_isFirstLetter = other.m_isFirstLetter; |
108 m_isOverWidget = other.isOverWidget(); | 108 m_isOverWidget = other.isOverWidget(); |
109 | 109 |
110 // Only copy the NodeSet in case of rect hit test. | 110 // Only copy the NodeSet in case of rect hit test. |
111 m_rectBasedTestResult = adoptPtrWillBeNoop(other.m_rectBasedTestResult ? new
NodeSet(*other.m_rectBasedTestResult) : 0); | 111 m_rectBasedTestResult = adoptPtrWillBeNoop(other.m_rectBasedTestResult ? new
NodeSet(*other.m_rectBasedTestResult) : 0); |
112 | 112 |
113 return *this; | 113 return *this; |
114 } | 114 } |
115 | 115 |
| 116 void HitTestResult::trace(Visitor* visitor) |
| 117 { |
| 118 visitor->trace(m_innerNode); |
| 119 visitor->trace(m_innerPossiblyPseudoNode); |
| 120 visitor->trace(m_innerNonSharedNode); |
| 121 visitor->trace(m_innerURLElement); |
| 122 #if ENABLE(OILPAN) |
| 123 visitor->trace(m_rectBasedTestResult); |
| 124 #endif |
| 125 } |
| 126 |
116 PositionWithAffinity HitTestResult::position() const | 127 PositionWithAffinity HitTestResult::position() const |
117 { | 128 { |
118 if (!m_innerPossiblyPseudoNode) | 129 if (!m_innerPossiblyPseudoNode) |
119 return PositionWithAffinity(); | 130 return PositionWithAffinity(); |
120 RenderObject* renderer = this->renderer(); | 131 RenderObject* renderer = this->renderer(); |
121 if (!renderer) | 132 if (!renderer) |
122 return PositionWithAffinity(); | 133 return PositionWithAffinity(); |
123 if (m_innerPossiblyPseudoNode->isPseudoElement() && m_innerPossiblyPseudoNod
e->pseudoId() == BEFORE) | 134 if (m_innerPossiblyPseudoNode->isPseudoElement() && m_innerPossiblyPseudoNod
e->pseudoId() == BEFORE) |
124 return Position(m_innerNode, Position::PositionIsBeforeChildren).downstr
eam(); | 135 return Position(m_innerNode, Position::PositionIsBeforeChildren).downstr
eam(); |
125 return renderer->positionForPoint(localPoint()); | 136 return renderer->positionForPoint(localPoint()); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 { | 467 { |
457 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { | 468 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { |
458 if (node->isElementNode()) | 469 if (node->isElementNode()) |
459 return toElement(node); | 470 return toElement(node); |
460 } | 471 } |
461 | 472 |
462 return 0; | 473 return 0; |
463 } | 474 } |
464 | 475 |
465 } // namespace blink | 476 } // namespace blink |
OLD | NEW |