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

Unified Diff: Source/core/editing/SelectionController.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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/SelectionController.cpp
diff --git a/Source/core/editing/SelectionController.cpp b/Source/core/editing/SelectionController.cpp
index aedec86c61742a6419dfef68170a26720c8c5d2a..6bae5fe0d4f51a8f689746cd444d268ca2e38361 100644
--- a/Source/core/editing/SelectionController.cpp
+++ b/Source/core/editing/SelectionController.cpp
@@ -313,7 +313,7 @@ void SelectionController::selectClosestWordFromHitTestResult(const HitTestResult
if (!innerNode || !innerNode->layoutObject())
return;
- VisiblePosition pos(innerNode->layoutObject()->positionForPoint(result.localPoint()));
+ VisiblePosition pos = visiblePositionOf(innerNode->layoutObject()->positionForPoint(result.localPoint()));
if (pos.isNotNull()) {
newSelection = VisibleSelection(pos);
expandSelectionUsingGranularity(newSelection, WordGranularity);
@@ -344,7 +344,7 @@ void SelectionController::selectClosestMisspellingFromHitTestResult(const HitTes
if (!innerNode || !innerNode->layoutObject())
return;
- VisiblePosition pos(innerNode->layoutObject()->positionForPoint(result.localPoint()));
+ VisiblePosition pos = visiblePositionOf(innerNode->layoutObject()->positionForPoint(result.localPoint()));
if (pos.isNotNull()) {
const Position markerPosition = pos.deepEquivalent().parentAnchoredEquivalent();
DocumentMarkerVector markers = innerNode->document().markers().markersInRange(EphemeralRange(markerPosition), DocumentMarker::MisspellingMarkers());
@@ -393,7 +393,7 @@ void SelectionController::selectClosestWordOrLinkFromMouseEvent(const MouseEvent
VisibleSelection newSelection;
Element* URLElement = result.hitTestResult().URLElement();
- VisiblePosition pos(innerNode->layoutObject()->positionForPoint(result.localPoint()));
+ VisiblePosition pos = visiblePositionOf(innerNode->layoutObject()->positionForPoint(result.localPoint()));
if (pos.isNotNull() && pos.deepEquivalent().anchorNode()->isDescendantOf(URLElement))
newSelection = VisibleSelection::selectionFromContentsOfNode(URLElement);
@@ -432,7 +432,7 @@ bool SelectionController::handleMousePressEventTripleClick(const MouseEventWithH
return false;
VisibleSelection newSelection;
- VisiblePosition pos(innerNode->layoutObject()->positionForPoint(event.localPoint()));
+ VisiblePosition pos = visiblePositionOf(innerNode->layoutObject()->positionForPoint(event.localPoint()));
if (pos.isNotNull()) {
newSelection = VisibleSelection(pos);
expandSelectionUsingGranularity(newSelection, ParagraphGranularity);
@@ -506,7 +506,7 @@ bool SelectionController::handleMouseReleaseEvent(const MouseEventWithHitTestRes
Node* node = event.innerNode();
bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
if (node && node->layoutObject() && (caretBrowsing || node->hasEditableStyle())) {
- VisiblePosition pos = VisiblePosition(node->layoutObject()->positionForPoint(event.localPoint()));
+ VisiblePosition pos = visiblePositionOf(node->layoutObject()->positionForPoint(event.localPoint()));
newSelection = VisibleSelection(pos);
}
@@ -615,7 +615,7 @@ void SelectionController::passMousePressEventToSubframe(const MouseEventWithHitT
if (!selection().contains(p))
return;
- VisiblePosition visiblePos(
+ VisiblePosition visiblePos = visiblePositionOf(
mev.innerNode()->layoutObject()->positionForPoint(mev.localPoint()));
VisibleSelection newSelection(visiblePos);
selection().setSelection(newSelection);
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698