| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 bool HitTestResult::isSelected() const | 232 bool HitTestResult::isSelected() const |
| 233 { | 233 { |
| 234 if (!m_innerNode) | 234 if (!m_innerNode) |
| 235 return false; | 235 return false; |
| 236 | 236 |
| 237 if (LocalFrame* frame = m_innerNode->document().frame()) | 237 if (LocalFrame* frame = m_innerNode->document().frame()) |
| 238 return frame->selection().contains(m_hitTestLocation.point()); | 238 return frame->selection().contains(m_hitTestLocation.point()); |
| 239 return false; | 239 return false; |
| 240 } | 240 } |
| 241 | 241 |
| 242 String HitTestResult::spellingToolTip(TextDirection& dir) const | |
| 243 { | |
| 244 dir = LTR; | |
| 245 // Return the tool tip string associated with this point, if any. Only marke
rs associated with bad grammar | |
| 246 // currently supply strings, but maybe someday markers associated with missp
elled words will also. | |
| 247 if (!m_innerNode) | |
| 248 return String(); | |
| 249 | |
| 250 DocumentMarker* marker = m_innerNode->document().markers().markerContainingP
oint(m_hitTestLocation.point(), DocumentMarker::Grammar); | |
| 251 if (!marker) | |
| 252 return String(); | |
| 253 | |
| 254 if (LayoutObject* layoutObject = m_innerNode->layoutObject()) | |
| 255 dir = layoutObject->style()->direction(); | |
| 256 return marker->description(); | |
| 257 } | |
| 258 | |
| 259 String HitTestResult::title(TextDirection& dir) const | 242 String HitTestResult::title(TextDirection& dir) const |
| 260 { | 243 { |
| 261 dir = LTR; | 244 dir = LTR; |
| 262 // Find the title in the nearest enclosing DOM node. | 245 // Find the title in the nearest enclosing DOM node. |
| 263 // For <area> tags in image maps, walk the tree for the <area>, not the <img
> using it. | 246 // For <area> tags in image maps, walk the tree for the <area>, not the <img
> using it. |
| 264 if (m_innerNode.get()) | 247 if (m_innerNode.get()) |
| 265 m_innerNode->updateDistribution(); | 248 m_innerNode->updateDistribution(); |
| 266 for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = FlatTreeTra
versal::parent(*titleNode)) { | 249 for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = FlatTreeTra
versal::parent(*titleNode)) { |
| 267 if (titleNode->isElementNode()) { | 250 if (titleNode->isElementNode()) { |
| 268 String title = toElement(titleNode)->title(); | 251 String title = toElement(titleNode)->title(); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 else if (isHTMLMapElement(m_innerNode)) | 512 else if (isHTMLMapElement(m_innerNode)) |
| 530 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); | 513 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); |
| 531 | 514 |
| 532 if (!imageMapImageElement) | 515 if (!imageMapImageElement) |
| 533 return m_innerNode.get(); | 516 return m_innerNode.get(); |
| 534 | 517 |
| 535 return imageMapImageElement; | 518 return imageMapImageElement; |
| 536 } | 519 } |
| 537 | 520 |
| 538 } // namespace blink | 521 } // namespace blink |
| OLD | NEW |