Changeset 74004 in webkit
- Timestamp:
- Dec 13, 2010 10:51:52 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r74003 r74004 1 2010-12-13 Antonio Gomes <agomes@rim.com> 2 3 Reviewed by Daniel Bates. 4 5 Spatial Navigation: code clean up (part IV) 6 https://bugs.webkit.org/show_bug.cgi?id=50666 7 8 Avoid calling canScrollInDirection more than necessary. 9 10 No new tests needed. 11 12 * page/FocusController.cpp: 13 (WebCore::FocusController::advanceFocusDirectionallyInContainer): Moved the call to canScrollInDirection() 14 to within the scrollInDirection(). 15 * page/SpatialNavigation.cpp: Removed the assertion to canScrollingDirection function. 16 (WebCore::scrollInDirection): 17 1 18 2010-12-13 Antonio Gomes <agomes@rim.com> 2 19 -
trunk/WebCore/page/FocusController.cpp
r74003 r74004 501 501 502 502 if (focusCandidate.isNull()) { 503 if (canScrollInDirection(direction, container)) { 504 // Nothing to focus, scroll if possible. 505 scrollInDirection(container, direction); 506 return true; 507 } 508 // Return false will cause a re-try, skipping this container. 509 return false; 503 // Nothing to focus, scroll if possible. 504 // NOTE: If no scrolling is performed (i.e. scrollInDirection returns false), the 505 // spatial navigation algorithm will skip this container. 506 return scrollInDirection(container, direction); 510 507 } 511 508 -
trunk/WebCore/page/SpatialNavigation.cpp
r74003 r74004 335 335 bool scrollInDirection(Frame* frame, FocusDirection direction) 336 336 { 337 ASSERT(frame && canScrollInDirection(direction, frame->document()));337 ASSERT(frame); 338 338 339 339 if (frame && canScrollInDirection(direction, frame->document())) { … … 366 366 bool scrollInDirection(Node* container, FocusDirection direction) 367 367 { 368 ASSERT(container); 368 369 if (container->isDocumentNode()) 369 370 return scrollInDirection(static_cast<Document*>(container)->frame(), direction); … … 372 373 return false; 373 374 374 if (c ontainer && canScrollInDirection(direction, container)) {375 if (canScrollInDirection(direction, container)) { 375 376 int dx = 0; 376 377 int dy = 0; … … 398 399 return true; 399 400 } 401 400 402 return false; 401 403 }
Note: See TracChangeset
for help on using the changeset viewer.