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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 2368903002: Ensure valid VisiblePosition input for character{Before,After} (Closed)
Patch Set: Add DCHECK for the correctness of postponing Created 4 years, 3 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 | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/VisibleUnits.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index 5a9dda91338e369e5a20e3c4d6e43df14c3f4b9e..6ab9347e7956955e656efcf9ca7369271f385b7e 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -2984,8 +2984,7 @@ static VisiblePositionTemplate<Strategy> skipToEndOfEditingBoundary(const Visibl
template <typename Strategy>
static UChar32 characterAfterAlgorithm(const VisiblePositionTemplate<Strategy>& visiblePosition)
{
- // TODO(xiaochengh): Ensure that this function is called with a valid
- // |visiblePosition|, and add |DCHECK(visiblePosition.isValid())|
+ DCHECK(visiblePosition.isValid()) << visiblePosition;
// We canonicalize to the first of two equivalent candidates, but the second
// of the two candidates is the one that will be inside the text node
// containing the character after this visible position.
@@ -3017,8 +3016,7 @@ UChar32 characterAfter(const VisiblePositionInFlatTree& visiblePosition)
template <typename Strategy>
static UChar32 characterBeforeAlgorithm(const VisiblePositionTemplate<Strategy>& visiblePosition)
{
- // TODO(xiaochengh): Ensure that this function is called with a valid
- // |visiblePosition|, and add |DCHECK(visiblePosition.isValid())|
+ DCHECK(visiblePosition.isValid()) << visiblePosition;
return characterAfter(previousPositionOf(visiblePosition));
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698