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

Side by Side Diff: Source/core/editing/VisibleSelection.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/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.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) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 { 1019 {
1020 if (m_startInComposedTree.isNull()) 1020 if (m_startInComposedTree.isNull())
1021 return; 1021 return;
1022 if (m_startInComposedTree.compareTo(m_endInComposedTree) <= 0) 1022 if (m_startInComposedTree.compareTo(m_endInComposedTree) <= 0)
1023 return; 1023 return;
1024 std::swap(m_startInComposedTree, m_endInComposedTree); 1024 std::swap(m_startInComposedTree, m_endInComposedTree);
1025 } 1025 }
1026 1026
1027 VisiblePosition VisibleSelection::visiblePositionRespectingEditingBoundary(const LayoutPoint& localPoint, Node* targetNode) const 1027 VisiblePosition VisibleSelection::visiblePositionRespectingEditingBoundary(const LayoutPoint& localPoint, Node* targetNode) const
1028 { 1028 {
1029 return VisiblePosition(positionRespectingEditingBoundary(localPoint, targetN ode)); 1029 return visiblePositionOf(positionRespectingEditingBoundary(localPoint, targe tNode));
1030 } 1030 }
1031 1031
1032 PositionWithAffinity VisibleSelection::positionRespectingEditingBoundary(const L ayoutPoint& localPoint, Node* targetNode) const 1032 PositionWithAffinity VisibleSelection::positionRespectingEditingBoundary(const L ayoutPoint& localPoint, Node* targetNode) const
1033 { 1033 {
1034 if (!targetNode->layoutObject()) 1034 if (!targetNode->layoutObject())
1035 return PositionWithAffinity(); 1035 return PositionWithAffinity();
1036 1036
1037 LayoutPoint selectionEndPoint = localPoint; 1037 LayoutPoint selectionEndPoint = localPoint;
1038 Element* editableElement = rootEditableElement(); 1038 Element* editableElement = rootEditableElement();
1039 1039
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 sel.showTreeForThis(); 1247 sel.showTreeForThis();
1248 } 1248 }
1249 1249
1250 void showTree(const blink::VisibleSelection* sel) 1250 void showTree(const blink::VisibleSelection* sel)
1251 { 1251 {
1252 if (sel) 1252 if (sel)
1253 sel->showTreeForThis(); 1253 sel->showTreeForThis();
1254 } 1254 }
1255 1255
1256 #endif 1256 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698