| 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 void HitTestResult::setScrollbar(Scrollbar* s) | 200 void HitTestResult::setScrollbar(Scrollbar* s) |
| 201 { | 201 { |
| 202 m_scrollbar = s; | 202 m_scrollbar = s; |
| 203 } | 203 } |
| 204 | 204 |
| 205 LocalFrame* HitTestResult::innerNodeFrame() const | 205 LocalFrame* HitTestResult::innerNodeFrame() const |
| 206 { | 206 { |
| 207 if (m_innerNode) | 207 if (m_innerNode) |
| 208 return m_innerNode->document().frame(); | 208 return m_innerNode->document().frame(); |
| 209 return 0; | 209 return nullptr; |
| 210 } | 210 } |
| 211 | 211 |
| 212 bool HitTestResult::isSelected() const | 212 bool HitTestResult::isSelected() const |
| 213 { | 213 { |
| 214 if (!m_innerNode) | 214 if (!m_innerNode) |
| 215 return false; | 215 return false; |
| 216 | 216 |
| 217 if (LocalFrame* frame = m_innerNode->document().frame()) | 217 if (LocalFrame* frame = m_innerNode->document().frame()) |
| 218 return frame->selection().contains(m_hitTestLocation.point()); | 218 return frame->selection().contains(m_hitTestLocation.point()); |
| 219 return false; | 219 return false; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 KURL HitTestResult::absoluteMediaURL() const | 325 KURL HitTestResult::absoluteMediaURL() const |
| 326 { | 326 { |
| 327 if (HTMLMediaElement* mediaElt = mediaElement()) | 327 if (HTMLMediaElement* mediaElt = mediaElement()) |
| 328 return mediaElt->currentSrc(); | 328 return mediaElt->currentSrc(); |
| 329 return KURL(); | 329 return KURL(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 HTMLMediaElement* HitTestResult::mediaElement() const | 332 HTMLMediaElement* HitTestResult::mediaElement() const |
| 333 { | 333 { |
| 334 if (!m_innerNode) | 334 if (!m_innerNode) |
| 335 return 0; | 335 return nullptr; |
| 336 | 336 |
| 337 if (!(m_innerNode->layoutObject() && m_innerNode->layoutObject()->isMedia())
) | 337 if (!(m_innerNode->layoutObject() && m_innerNode->layoutObject()->isMedia())
) |
| 338 return 0; | 338 return nullptr; |
| 339 | 339 |
| 340 if (isHTMLMediaElement(*m_innerNode)) | 340 if (isHTMLMediaElement(*m_innerNode)) |
| 341 return toHTMLMediaElement(m_innerNode); | 341 return toHTMLMediaElement(m_innerNode); |
| 342 return 0; | 342 return nullptr; |
| 343 } | 343 } |
| 344 | 344 |
| 345 KURL HitTestResult::absoluteLinkURL() const | 345 KURL HitTestResult::absoluteLinkURL() const |
| 346 { | 346 { |
| 347 if (!m_innerURLElement) | 347 if (!m_innerURLElement) |
| 348 return KURL(); | 348 return KURL(); |
| 349 return m_innerURLElement->hrefURL(); | 349 return m_innerURLElement->hrefURL(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 bool HitTestResult::isLiveLink() const | 352 bool HitTestResult::isLiveLink() const |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 ASSERT(!isRectBasedTest()); | 490 ASSERT(!isRectBasedTest()); |
| 491 } | 491 } |
| 492 | 492 |
| 493 Element* HitTestResult::innerElement() const | 493 Element* HitTestResult::innerElement() const |
| 494 { | 494 { |
| 495 for (Node* node = m_innerNode.get(); node; node = ComposedTreeTraversal::par
ent(*node)) { | 495 for (Node* node = m_innerNode.get(); node; node = ComposedTreeTraversal::par
ent(*node)) { |
| 496 if (node->isElementNode()) | 496 if (node->isElementNode()) |
| 497 return toElement(node); | 497 return toElement(node); |
| 498 } | 498 } |
| 499 | 499 |
| 500 return 0; | 500 return nullptr; |
| 501 } | 501 } |
| 502 | 502 |
| 503 Node* HitTestResult::innerNodeOrImageMapImage() const | 503 Node* HitTestResult::innerNodeOrImageMapImage() const |
| 504 { | 504 { |
| 505 if (!m_innerNode) | 505 if (!m_innerNode) |
| 506 return nullptr; | 506 return nullptr; |
| 507 | 507 |
| 508 HTMLImageElement* imageMapImageElement = nullptr; | 508 HTMLImageElement* imageMapImageElement = nullptr; |
| 509 if (isHTMLAreaElement(m_innerNode)) | 509 if (isHTMLAreaElement(m_innerNode)) |
| 510 imageMapImageElement = toHTMLAreaElement(m_innerNode)->imageElement(); | 510 imageMapImageElement = toHTMLAreaElement(m_innerNode)->imageElement(); |
| 511 else if (isHTMLMapElement(m_innerNode)) | 511 else if (isHTMLMapElement(m_innerNode)) |
| 512 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); | 512 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); |
| 513 | 513 |
| 514 if (!imageMapImageElement) | 514 if (!imageMapImageElement) |
| 515 return m_innerNode.get(); | 515 return m_innerNode.get(); |
| 516 | 516 |
| 517 return imageMapImageElement; | 517 return imageMapImageElement; |
| 518 } | 518 } |
| 519 | 519 |
| 520 } // namespace blink | 520 } // namespace blink |
| OLD | NEW |