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

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

Issue 340713003: Ignore visibility when checking whether Position is editable or not at DeletetSelectionCommand (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-19T03:44:02 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 | « Source/core/editing/htmlediting.h ('k') | 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 4608209552fff16973db40fa1fabc8853bac12f3..aca644cd900106ae3d0f30bd457817cd1818831d 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -285,16 +285,21 @@ VisiblePosition firstEditableVisiblePositionAfterPositionInRoot(const Position&
VisiblePosition lastEditableVisiblePositionBeforePositionInRoot(const Position& position, Node* highestRoot)
{
+ return VisiblePosition(lastEditablePositionBeforePositionInRoot(position, highestRoot));
+}
+
+Position lastEditablePositionBeforePositionInRoot(const Position& position, Node* highestRoot)
+{
// When position falls after highestRoot, the result is easy to compute.
if (comparePositions(position, lastPositionInNode(highestRoot)) == 1)
- return VisiblePosition(lastPositionInNode(highestRoot));
+ return lastPositionInNode(highestRoot);
Position editablePosition = position;
if (position.deprecatedNode()->treeScope() != highestRoot->treeScope()) {
Node* shadowAncestor = highestRoot->treeScope().ancestorInThisScope(editablePosition.deprecatedNode());
if (!shadowAncestor)
- return VisiblePosition();
+ return Position();
editablePosition = firstPositionInOrBeforeNode(shadowAncestor);
}
@@ -303,9 +308,8 @@ VisiblePosition lastEditableVisiblePositionBeforePositionInRoot(const Position&
editablePosition = isAtomicNode(editablePosition.deprecatedNode()) ? positionInParentBeforeNode(*editablePosition.deprecatedNode()) : previousVisuallyDistinctCandidate(editablePosition);
if (editablePosition.deprecatedNode() && editablePosition.deprecatedNode() != highestRoot && !editablePosition.deprecatedNode()->isDescendantOf(highestRoot))
- return VisiblePosition();
-
- return VisiblePosition(editablePosition);
+ return Position();
+ return editablePosition;
}
// FIXME: The method name, comment, and code say three different things here!
« no previous file with comments | « Source/core/editing/htmlediting.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698