| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 199 } |
| 200 | 200 |
| 201 String HitTestResult::spellingToolTip(TextDirection& dir) const | 201 String HitTestResult::spellingToolTip(TextDirection& dir) const |
| 202 { | 202 { |
| 203 dir = LTR; | 203 dir = LTR; |
| 204 // Return the tool tip string associated with this point, if any. Only marke
rs associated with bad grammar | 204 // Return the tool tip string associated with this point, if any. Only marke
rs associated with bad grammar |
| 205 // currently supply strings, but maybe someday markers associated with missp
elled words will also. | 205 // currently supply strings, but maybe someday markers associated with missp
elled words will also. |
| 206 if (!m_innerNonSharedNode) | 206 if (!m_innerNonSharedNode) |
| 207 return String(); | 207 return String(); |
| 208 | 208 |
| 209 DocumentMarker* marker = m_innerNonSharedNode->document().markers()->markerC
ontainingPoint(m_hitTestLocation.point(), DocumentMarker::Grammar); | 209 DocumentMarker* marker = m_innerNonSharedNode->document().markers().markerCo
ntainingPoint(m_hitTestLocation.point(), DocumentMarker::Grammar); |
| 210 if (!marker) | 210 if (!marker) |
| 211 return String(); | 211 return String(); |
| 212 | 212 |
| 213 if (RenderObject* renderer = m_innerNonSharedNode->renderer()) | 213 if (RenderObject* renderer = m_innerNonSharedNode->renderer()) |
| 214 dir = renderer->style()->direction(); | 214 dir = renderer->style()->direction(); |
| 215 return marker->description(); | 215 return marker->description(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 String HitTestResult::title(TextDirection& dir) const | 218 String HitTestResult::title(TextDirection& dir) const |
| 219 { | 219 { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 return false; | 345 return false; |
| 346 } | 346 } |
| 347 | 347 |
| 348 bool HitTestResult::isMisspelled() const | 348 bool HitTestResult::isMisspelled() const |
| 349 { | 349 { |
| 350 if (!targetNode()) | 350 if (!targetNode()) |
| 351 return false; | 351 return false; |
| 352 VisiblePosition pos(targetNode()->renderer()->positionForPoint(localPoint())
); | 352 VisiblePosition pos(targetNode()->renderer()->positionForPoint(localPoint())
); |
| 353 if (pos.isNull()) | 353 if (pos.isNull()) |
| 354 return false; | 354 return false; |
| 355 return m_innerNonSharedNode->document().markers()->markersInRange( | 355 return m_innerNonSharedNode->document().markers().markersInRange( |
| 356 makeRange(pos, pos).get(), DocumentMarker::MisspellingMarkers()).size()
> 0; | 356 makeRange(pos, pos).get(), DocumentMarker::MisspellingMarkers()).size()
> 0; |
| 357 } | 357 } |
| 358 | 358 |
| 359 bool HitTestResult::isOverLink() const | 359 bool HitTestResult::isOverLink() const |
| 360 { | 360 { |
| 361 return m_innerURLElement && m_innerURLElement->isLink(); | 361 return m_innerURLElement && m_innerURLElement->isLink(); |
| 362 } | 362 } |
| 363 | 363 |
| 364 String HitTestResult::titleDisplayString() const | 364 String HitTestResult::titleDisplayString() const |
| 365 { | 365 { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 { | 492 { |
| 493 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { | 493 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { |
| 494 if (node->isElementNode()) | 494 if (node->isElementNode()) |
| 495 return toElement(node); | 495 return toElement(node); |
| 496 } | 496 } |
| 497 | 497 |
| 498 return 0; | 498 return 0; |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace WebCore | 501 } // namespace WebCore |
| OLD | NEW |