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

Unified Diff: Source/core/editing/htmlediting.cpp

Issue 342553008: Avoid to use abbreviated names in {first,last}EditableVisiblePosition{After,Before}PositionInRoot (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index bb0baba0474269e257ed41051f58cd85cae9a60e..4608209552fff16973db40fa1fabc8853bac12f3 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -264,23 +264,23 @@ VisiblePosition firstEditableVisiblePositionAfterPositionInRoot(const Position&
if (comparePositions(position, firstPositionInNode(highestRoot)) == -1 && highestRoot->rendererIsEditable())
return VisiblePosition(firstPositionInNode(highestRoot));
- Position p = position;
+ Position editablePosition = position;
if (position.deprecatedNode()->treeScope() != highestRoot->treeScope()) {
- Node* shadowAncestor = highestRoot->treeScope().ancestorInThisScope(p.deprecatedNode());
+ Node* shadowAncestor = highestRoot->treeScope().ancestorInThisScope(editablePosition.deprecatedNode());
if (!shadowAncestor)
return VisiblePosition();
- p = positionAfterNode(shadowAncestor);
+ editablePosition = positionAfterNode(shadowAncestor);
}
- while (p.deprecatedNode() && !isEditablePosition(p) && p.deprecatedNode()->isDescendantOf(highestRoot))
- p = isAtomicNode(p.deprecatedNode()) ? positionInParentAfterNode(*p.deprecatedNode()) : nextVisuallyDistinctCandidate(p);
+ while (editablePosition.deprecatedNode() && !isEditablePosition(editablePosition) && editablePosition.deprecatedNode()->isDescendantOf(highestRoot))
+ editablePosition = isAtomicNode(editablePosition.deprecatedNode()) ? positionInParentAfterNode(*editablePosition.deprecatedNode()) : nextVisuallyDistinctCandidate(editablePosition);
- if (p.deprecatedNode() && p.deprecatedNode() != highestRoot && !p.deprecatedNode()->isDescendantOf(highestRoot))
+ if (editablePosition.deprecatedNode() && editablePosition.deprecatedNode() != highestRoot && !editablePosition.deprecatedNode()->isDescendantOf(highestRoot))
return VisiblePosition();
- return VisiblePosition(p);
+ return VisiblePosition(editablePosition);
}
VisiblePosition lastEditableVisiblePositionBeforePositionInRoot(const Position& position, Node* highestRoot)
@@ -289,23 +289,23 @@ VisiblePosition lastEditableVisiblePositionBeforePositionInRoot(const Position&
if (comparePositions(position, lastPositionInNode(highestRoot)) == 1)
return VisiblePosition(lastPositionInNode(highestRoot));
- Position p = position;
+ Position editablePosition = position;
if (position.deprecatedNode()->treeScope() != highestRoot->treeScope()) {
- Node* shadowAncestor = highestRoot->treeScope().ancestorInThisScope(p.deprecatedNode());
+ Node* shadowAncestor = highestRoot->treeScope().ancestorInThisScope(editablePosition.deprecatedNode());
if (!shadowAncestor)
return VisiblePosition();
- p = firstPositionInOrBeforeNode(shadowAncestor);
+ editablePosition = firstPositionInOrBeforeNode(shadowAncestor);
}
- while (p.deprecatedNode() && !isEditablePosition(p) && p.deprecatedNode()->isDescendantOf(highestRoot))
- p = isAtomicNode(p.deprecatedNode()) ? positionInParentBeforeNode(*p.deprecatedNode()) : previousVisuallyDistinctCandidate(p);
+ while (editablePosition.deprecatedNode() && !isEditablePosition(editablePosition) && editablePosition.deprecatedNode()->isDescendantOf(highestRoot))
+ editablePosition = isAtomicNode(editablePosition.deprecatedNode()) ? positionInParentBeforeNode(*editablePosition.deprecatedNode()) : previousVisuallyDistinctCandidate(editablePosition);
- if (p.deprecatedNode() && p.deprecatedNode() != highestRoot && !p.deprecatedNode()->isDescendantOf(highestRoot))
+ if (editablePosition.deprecatedNode() && editablePosition.deprecatedNode() != highestRoot && !editablePosition.deprecatedNode()->isDescendantOf(highestRoot))
return VisiblePosition();
- return VisiblePosition(p);
+ return VisiblePosition(editablePosition);
}
// FIXME: The method name, comment, and code say three different things here!
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698