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

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

Issue 1878473002: ASSERT -> DCHECK in core/editing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Output info for some DCHECKs, add TODOs. Created 4 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
Index: third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
index 9d9ea95f5040feec7ebf9794627f590d1496fca5..51af3d904f09271a648b4ed803aa22bf8211f56d 100644
--- a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
@@ -42,7 +42,7 @@ Node* enclosingShadowHost(Node* node)
bool isEnclosedBy(const PositionInFlatTree& position, const Node& node)
{
- ASSERT(position.isNotNull());
+ DCHECK(position.isNotNull());
Node* anchorNode = position.anchorNode();
if (anchorNode == node)
return !position.isAfterAnchor() && !position.isBeforeAnchor();
@@ -101,7 +101,7 @@ Position adjustPositionForEnd(const Position& currentPosition, Node* startContai
{
TreeScope& treeScope = startContainerNode->treeScope();
- ASSERT(currentPosition.computeContainerNode()->treeScope() != treeScope);
+ DCHECK(currentPosition.computeContainerNode()->treeScope() != treeScope);
if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.computeContainerNode())) {
if (ancestor->contains(startContainerNode))
@@ -135,7 +135,7 @@ Position adjustPositionForStart(const Position& currentPosition, Node* endContai
{
TreeScope& treeScope = endContainerNode->treeScope();
- ASSERT(currentPosition.computeContainerNode()->treeScope() != treeScope);
+ DCHECK(currentPosition.computeContainerNode()->treeScope() != treeScope);
if (Node* ancestor = treeScope.ancestorInThisScope(currentPosition.computeContainerNode())) {
if (ancestor->contains(endContainerNode))
@@ -231,10 +231,10 @@ void SelectionAdjuster::adjustSelectionInDOMTree(VisibleSelection* selection, co
void SelectionAdjuster::adjustSelectionToAvoidCrossingShadowBoundaries(VisibleSelection* selection)
{
// Note: |m_selectionType| isn't computed yet.
- ASSERT(selection->base().isNotNull());
- ASSERT(selection->extent().isNotNull());
- ASSERT(selection->start().isNotNull());
- ASSERT(selection->end().isNotNull());
+ DCHECK(selection->base().isNotNull());
+ DCHECK(selection->extent().isNotNull());
+ DCHECK(selection->start().isNotNull());
+ DCHECK(selection->end().isNotNull());
// TODO(hajimehoshi): Checking treeScope is wrong when a node is
// distributed, but we leave it as it is for backward compatibility.

Powered by Google App Engine
This is Rietveld 408576698