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

Unified Diff: third_party/WebKit/Source/core/page/SpatialNavigation.cpp

Issue 2899573002: Clean up remaining uses of ASSERT in core (Closed)
Patch Set: Clean up remaining uses of ASSERT in core Created 3 years, 7 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/page/SpatialNavigation.cpp
diff --git a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
index bba96114c553f431aa252da6d0a71eba828d7454..7792db98bc4d148f3e96567b5dd2fdce314b419a 100644
--- a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
+++ b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
@@ -249,16 +249,16 @@ bool ScrollInDirection(Node* container, WebFocusType type) {
dx = -pixels_per_line_step;
break;
case kWebFocusTypeRight:
- ASSERT(container->GetLayoutBox()->ScrollWidth() >
- (container->GetLayoutBox()->ScrollLeft() +
- container->GetLayoutBox()->ClientWidth()));
+ DCHECK_GT(container->GetLayoutBox()->ScrollWidth(),
+ (container->GetLayoutBox()->ScrollLeft() +
+ container->GetLayoutBox()->ClientWidth()));
dx = pixels_per_line_step;
break;
case kWebFocusTypeUp:
dy = -pixels_per_line_step;
break;
case kWebFocusTypeDown:
- ASSERT(container->GetLayoutBox()->ScrollHeight() -
+ DCHECK(container->GetLayoutBox()->ScrollHeight() -
(container->GetLayoutBox()->ScrollTop() +
container->GetLayoutBox()->ClientHeight()));
dy = pixels_per_line_step;
@@ -408,8 +408,9 @@ static LayoutRect RectToAbsoluteCoordinates(LocalFrame* initial_frame,
}
LayoutRect NodeRectInAbsoluteCoordinates(Node* node, bool ignore_border) {
- ASSERT(node && node->GetLayoutObject() &&
- !node->GetDocument().View()->NeedsLayout());
+ DCHECK(node);
+ DCHECK(node->GetLayoutObject());
+ DCHECK(!node->GetDocument().View()->NeedsLayout());
if (node->IsDocumentNode())
return FrameRectInAbsoluteCoordinates(ToDocument(node)->GetFrame());
@@ -624,7 +625,8 @@ void DistanceDataForNode(WebFocusType type,
}
bool CanBeScrolledIntoView(WebFocusType type, const FocusCandidate& candidate) {
- ASSERT(candidate.visible_node && candidate.is_offscreen);
+ DCHECK(candidate.visible_node);
+ DCHECK(candidate.is_offscreen);
LayoutRect candidate_rect = candidate.rect;
for (Node& parent_node :
NodeTraversal::AncestorsOf(*candidate.visible_node)) {
« no previous file with comments | « third_party/WebKit/Source/core/page/FrameTree.cpp ('k') | third_party/WebKit/Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698