Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: Source/core/layout/HitTestResult.cpp

Issue 1326563002: Introduce visiblePositionOf() with PositionWithAffinity as replacement of VisiblePosition constructo (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-01T10:55:04 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 if (!m_innerURLElement) 379 if (!m_innerURLElement)
380 return KURL(); 380 return KURL();
381 return m_innerURLElement->hrefURL(); 381 return m_innerURLElement->hrefURL();
382 } 382 }
383 383
384 bool HitTestResult::isLiveLink() const 384 bool HitTestResult::isLiveLink() const
385 { 385 {
386 return m_innerURLElement && m_innerURLElement->isLiveLink(); 386 return m_innerURLElement && m_innerURLElement->isLiveLink();
387 } 387 }
388 388
389 // TODO(yosin) We should move |HitTestResult::isMisspelled()| to
390 // "SelectionController.cpp" as static function.
389 bool HitTestResult::isMisspelled() const 391 bool HitTestResult::isMisspelled() const
390 { 392 {
391 if (!innerNode() || !innerNode()->layoutObject()) 393 if (!innerNode() || !innerNode()->layoutObject())
392 return false; 394 return false;
393 VisiblePosition pos(innerNode()->layoutObject()->positionForPoint(localPoint ())); 395 VisiblePosition pos = visiblePositionOf(innerNode()->layoutObject()->positio nForPoint(localPoint()));
394 if (pos.isNull()) 396 if (pos.isNull())
395 return false; 397 return false;
396 return m_innerNode->document().markers().markersInRange( 398 return m_innerNode->document().markers().markersInRange(
397 EphemeralRange(pos.deepEquivalent().parentAnchoredEquivalent()), Documen tMarker::MisspellingMarkers()).size() > 0; 399 EphemeralRange(pos.deepEquivalent().parentAnchoredEquivalent()), Documen tMarker::MisspellingMarkers()).size() > 0;
398 } 400 }
399 401
400 bool HitTestResult::isOverLink() const 402 bool HitTestResult::isOverLink() const
401 { 403 {
402 return m_innerURLElement && m_innerURLElement->isLink(); 404 return m_innerURLElement && m_innerURLElement->isLink();
403 } 405 }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 else if (isHTMLMapElement(m_innerNode)) 526 else if (isHTMLMapElement(m_innerNode))
525 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); 527 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement();
526 528
527 if (!imageMapImageElement) 529 if (!imageMapImageElement)
528 return m_innerNode.get(); 530 return m_innerNode.get();
529 531
530 return imageMapImageElement; 532 return imageMapImageElement;
531 } 533 }
532 534
533 } // namespace blink 535 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698