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

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

Issue 2373483003: Ensure valid VisiblePosition input for absoluteCaretBoundsOf (Closed)
Patch Set: Ensure valid VP for absoluteCaretBoundsOf 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
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 6ab9347e7956955e656efcf9ca7369271f385b7e..2916f42d34ea534f485d3bcc3a4bf51a3cc11ec9 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -2936,8 +2936,7 @@ bool isVisuallyEquivalentCandidate(const PositionInFlatTree& position)
template <typename Strategy>
static IntRect absoluteCaretBoundsOfAlgorithm(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;
LayoutObject* layoutObject;
LayoutRect localRect = localCaretRectOfPosition(visiblePosition.toPositionWithAffinity(), layoutObject);
if (localRect.isEmpty() || !layoutObject)

Powered by Google App Engine
This is Rietveld 408576698