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! |