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

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

Issue 1310043003: Introduce previousPositionOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T16:28:03 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 | « no previous file | Source/core/editing/Editor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingUtilities.cpp
diff --git a/Source/core/editing/EditingUtilities.cpp b/Source/core/editing/EditingUtilities.cpp
index 10e9586950e1d05fd1d47f36e3fcf9a4bd09b1c0..f9f43ba9a937a160d513d274bd69ddf269d15c52 100644
--- a/Source/core/editing/EditingUtilities.cpp
+++ b/Source/core/editing/EditingUtilities.cpp
@@ -815,7 +815,7 @@ static HTMLElement* lastInSpecialElement(const Position& pos)
HTMLElement* specialElement = toHTMLElement(n);
VisiblePosition vPos = VisiblePosition(pos);
VisiblePosition lastInElement = VisiblePosition(lastPositionInOrAfterNode(specialElement));
- if (isRenderedTableElement(specialElement) && vPos.deepEquivalent() == lastInElement.previous().deepEquivalent())
+ if (isRenderedTableElement(specialElement) && vPos.deepEquivalent() == previousPositionOf(lastInElement).deepEquivalent())
return specialElement;
if (vPos.deepEquivalent() == lastInElement.deepEquivalent())
return specialElement;
@@ -1471,7 +1471,7 @@ VisibleSelection selectionForParagraphIteration(const VisibleSelection& original
// (a table is itself a paragraph).
if (Element* table = isFirstPositionAfterTable(endOfSelection)) {
if (startOfSelection.deepEquivalent().anchorNode()->isDescendantOf(table))
- newSelection = VisibleSelection(startOfSelection, endOfSelection.previous(CannotCrossEditingBoundary));
+ newSelection = VisibleSelection(startOfSelection, previousPositionOf(endOfSelection, CannotCrossEditingBoundary));
}
// If the start of the selection to modify is just before a table,
« no previous file with comments | « no previous file | Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698