Changeset 74004 in webkit


Ignore:
Timestamp:
Dec 13, 2010 10:51:52 PM (13 years ago)
Author:
tonikitoo@webkit.org
Message:

2010-12-13 Antonio Gomes <agomes@rim.com>

Reviewed by Daniel Bates.

Spatial Navigation: code clean up (part IV)
https://bugs.webkit.org/show_bug.cgi?id=50666

Avoid calling canScrollInDirection more than necessary.

No new tests needed.

  • page/FocusController.cpp: (WebCore::FocusController::advanceFocusDirectionallyInContainer): Moved the call to canScrollInDirection() to within the scrollInDirection().
  • page/SpatialNavigation.cpp: Removed the assertion to canScrollingDirection function. (WebCore::scrollInDirection):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r74003 r74004  
     12010-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
    1182010-12-13  Antonio Gomes  <agomes@rim.com>
    219
  • trunk/WebCore/page/FocusController.cpp

    r74003 r74004  
    501501
    502502    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);
    510507    }
    511508
  • trunk/WebCore/page/SpatialNavigation.cpp

    r74003 r74004  
    335335bool scrollInDirection(Frame* frame, FocusDirection direction)
    336336{
    337     ASSERT(frame && canScrollInDirection(direction, frame->document()));
     337    ASSERT(frame);
    338338
    339339    if (frame && canScrollInDirection(direction, frame->document())) {
     
    366366bool scrollInDirection(Node* container, FocusDirection direction)
    367367{
     368    ASSERT(container);
    368369    if (container->isDocumentNode())
    369370        return scrollInDirection(static_cast<Document*>(container)->frame(), direction);
     
    372373        return false;
    373374
    374     if (container && canScrollInDirection(direction, container)) {
     375    if (canScrollInDirection(direction, container)) {
    375376        int dx = 0;
    376377        int dy = 0;
     
    398399        return true;
    399400    }
     401
    400402    return false;
    401403}
Note: See TracChangeset for help on using the changeset viewer.