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

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

Issue 1085163002: Introduce EditingAlgorithm<Traversal> class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-04-15T16:50:42 Rebase for Position.h updates Created 5 years, 8 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 3257aba9036f465d5c9d62eb1e691e7cde7f002c..8a97e2dae4e0c5b258967fd3978fde2a34415ef7 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -364,20 +364,7 @@ TextDirection directionOfEnclosingBlock(const Position& position)
// on a Position before using it to create a DOM Range, or an exception will be thrown.
int lastOffsetForEditing(const Node* node)
{
- ASSERT(node);
- if (!node)
- return 0;
- if (node->offsetInCharacters())
- return node->maxCharacterOffset();
-
- if (node->hasChildren())
- return node->countChildren();
-
- // NOTE: This should preempt the childNodeCount for, e.g., select nodes
- if (editingIgnoresContent(node))
- return 1;
-
- return 0;
+ return EditingStrategy::lastOffsetForEditing(node);
}
String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool endIsEndOfParagraph)
« 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