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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if (m_innerNode) | 224 if (m_innerNode) |
225 return m_innerNode->document().frame(); | 225 return m_innerNode->document().frame(); |
226 return nullptr; | 226 return nullptr; |
227 } | 227 } |
228 | 228 |
229 bool HitTestResult::isSelected() const { | 229 bool HitTestResult::isSelected() const { |
230 if (!m_innerNode) | 230 if (!m_innerNode) |
231 return false; | 231 return false; |
232 | 232 |
233 if (LocalFrame* frame = m_innerNode->document().frame()) | 233 if (LocalFrame* frame = m_innerNode->document().frame()) |
234 return frame->selection().contains(m_hitTestLocation.point()); | 234 return frame->selection().contains(*this); |
235 return false; | 235 return false; |
236 } | 236 } |
237 | 237 |
238 String HitTestResult::title(TextDirection& dir) const { | 238 String HitTestResult::title(TextDirection& dir) const { |
239 dir = LTR; | 239 dir = LTR; |
240 // Find the title in the nearest enclosing DOM node. | 240 // Find the title in the nearest enclosing DOM node. |
241 // For <area> tags in image maps, walk the tree for the <area>, not the <img>
using it. | 241 // For <area> tags in image maps, walk the tree for the <area>, not the <img>
using it. |
242 if (m_innerNode.get()) | 242 if (m_innerNode.get()) |
243 m_innerNode->updateDistribution(); | 243 m_innerNode->updateDistribution(); |
244 for (Node* titleNode = m_innerNode.get(); titleNode; | 244 for (Node* titleNode = m_innerNode.get(); titleNode; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 else if (isHTMLMapElement(m_innerNode)) | 496 else if (isHTMLMapElement(m_innerNode)) |
497 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); | 497 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); |
498 | 498 |
499 if (!imageMapImageElement) | 499 if (!imageMapImageElement) |
500 return m_innerNode.get(); | 500 return m_innerNode.get(); |
501 | 501 |
502 return imageMapImageElement; | 502 return imageMapImageElement; |
503 } | 503 } |
504 | 504 |
505 } // namespace blink | 505 } // namespace blink |
OLD | NEW |