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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 if (m_innerPossiblyPseudoNode->isPseudoElement() && m_innerPossiblyPseudoNod
e->pseudoId() == BEFORE) | 131 if (m_innerPossiblyPseudoNode->isPseudoElement() && m_innerPossiblyPseudoNod
e->pseudoId() == BEFORE) |
132 return Position(m_innerNode, Position::PositionIsBeforeChildren).downstr
eam(); | 132 return Position(m_innerNode, Position::PositionIsBeforeChildren).downstr
eam(); |
133 return renderer->positionForPoint(localPoint()); | 133 return renderer->positionForPoint(localPoint()); |
134 } | 134 } |
135 | 135 |
136 LayoutObject* HitTestResult::renderer() const | 136 LayoutObject* HitTestResult::renderer() const |
137 { | 137 { |
138 return m_innerNode ? m_innerNode->renderer() : 0; | 138 return m_innerNode ? m_innerNode->renderer() : 0; |
139 } | 139 } |
140 | 140 |
141 void HitTestResult::setToShadowHostIfInUserAgentShadowRoot() | 141 void HitTestResult::setToShadowHostIfInClosedShadowRoot() |
142 { | 142 { |
143 if (Node* node = innerNode()) { | 143 if (Node* node = innerNode()) { |
144 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) { | 144 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) { |
145 if (containingShadowRoot->type() == ShadowRoot::UserAgentShadowRoot) | 145 if (containingShadowRoot->type() == ShadowRoot::ClosedShadowRoot) |
146 setInnerNode(node->shadowHost()); | 146 setInnerNode(node->shadowHost()); |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 if (Node* node = innerNonSharedNode()) { | 150 if (Node* node = innerNonSharedNode()) { |
151 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) { | 151 if (ShadowRoot* containingShadowRoot = node->containingShadowRoot()) { |
152 if (containingShadowRoot->type() == ShadowRoot::UserAgentShadowRoot) | 152 if (containingShadowRoot->type() == ShadowRoot::ClosedShadowRoot) |
153 setInnerNonSharedNode(node->shadowHost()); | 153 setInnerNonSharedNode(node->shadowHost()); |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 void HitTestResult::setInnerNode(Node* n) | 158 void HitTestResult::setInnerNode(Node* n) |
159 { | 159 { |
160 m_innerPossiblyPseudoNode = n; | 160 m_innerPossiblyPseudoNode = n; |
161 if (n && n->isPseudoElement()) | 161 if (n && n->isPseudoElement()) |
162 n = n->parentOrShadowHostNode(); | 162 n = n->parentOrShadowHostNode(); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 { | 467 { |
468 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)) { |
469 if (node->isElementNode()) | 469 if (node->isElementNode()) |
470 return toElement(node); | 470 return toElement(node); |
471 } | 471 } |
472 | 472 |
473 return 0; | 473 return 0; |
474 } | 474 } |
475 | 475 |
476 } // namespace blink | 476 } // namespace blink |
OLD | NEW |