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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 m_scrollbar = other.scrollbar(); | 107 m_scrollbar = other.scrollbar(); |
108 m_isFirstLetter = other.m_isFirstLetter; | 108 m_isFirstLetter = other.m_isFirstLetter; |
109 m_isOverWidget = other.isOverWidget(); | 109 m_isOverWidget = other.isOverWidget(); |
110 | 110 |
111 // Only copy the NodeSet in case of rect hit test. | 111 // Only copy the NodeSet in case of rect hit test. |
112 m_rectBasedTestResult = adoptPtrWillBeNoop(other.m_rectBasedTestResult ? new
NodeSet(*other.m_rectBasedTestResult) : 0); | 112 m_rectBasedTestResult = adoptPtrWillBeNoop(other.m_rectBasedTestResult ? new
NodeSet(*other.m_rectBasedTestResult) : 0); |
113 | 113 |
114 return *this; | 114 return *this; |
115 } | 115 } |
116 | 116 |
| 117 void HitTestResult::trace(Visitor* visitor) |
| 118 { |
| 119 visitor->trace(m_innerNode); |
| 120 visitor->trace(m_innerPossiblyPseudoNode); |
| 121 visitor->trace(m_innerNonSharedNode); |
| 122 visitor->trace(m_innerURLElement); |
| 123 #if ENABLE(OILPAN) |
| 124 visitor->trace(m_rectBasedTestResult); |
| 125 #endif |
| 126 } |
| 127 |
117 RenderObject* HitTestResult::renderer() const | 128 RenderObject* HitTestResult::renderer() const |
118 { | 129 { |
119 if (!m_innerNode) | 130 if (!m_innerNode) |
120 return 0; | 131 return 0; |
121 RenderObject* renderer = m_innerNode->renderer(); | 132 RenderObject* renderer = m_innerNode->renderer(); |
122 if (!m_isFirstLetter || !renderer || !renderer->isText() || !toRenderText(re
nderer)->isTextFragment()) | 133 if (!m_isFirstLetter || !renderer || !renderer->isText() || !toRenderText(re
nderer)->isTextFragment()) |
123 return renderer; | 134 return renderer; |
124 return toRenderTextFragment(renderer)->firstRenderTextInFirstLetter(); | 135 return toRenderTextFragment(renderer)->firstRenderTextInFirstLetter(); |
125 } | 136 } |
126 | 137 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 { | 497 { |
487 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { | 498 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { |
488 if (node->isElementNode()) | 499 if (node->isElementNode()) |
489 return toElement(node); | 500 return toElement(node); |
490 } | 501 } |
491 | 502 |
492 return 0; | 503 return 0; |
493 } | 504 } |
494 | 505 |
495 } // namespace WebCore | 506 } // namespace WebCore |
OLD | NEW |