Changeset 56311 in webkit


Ignore:
Timestamp:
Mar 20, 2010 3:20:12 PM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

Spatial Navigation: Code simplification in FocusController.cpp and SpatialNavigation.cpp (part I)
https://bugs.webkit.org/show_bug.cgi?id=36168

Reviewed by Kenneth Christiansen.
Patch by Antonio Gomes <tonikitoo@webkit.org>

Make use of isNull and document methods introduced in FocusCandidate class by patch in bug 36167.
No functionalty change.

  • page/FocusController.cpp:

(WebCore::updateFocusCandidateIfCloser):

  • page/SpatialNavigation.cpp:

(WebCore::distanceInDirection):

Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56309 r56311  
     12010-03-20  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Kenneth Christiansen.
     4        Patch by Antonio Gomes <tonikitoo@webkit.org>
     5
     6        Spatial Navigation: Code simplification in FocusController.cpp and SpatialNavigation.cpp (part I)
     7        https://bugs.webkit.org/show_bug.cgi?id=36168
     8
     9        Make use of isNull and document methods introduced in FocusCandidate class by patch in bug 36167.
     10        No functionalty change.
     11
     12        * page/FocusController.cpp:
     13        (WebCore::updateFocusCandidateIfCloser):
     14        * page/SpatialNavigation.cpp:
     15        (WebCore::distanceInDirection):
     16
    1172010-03-20  Kevin Ollivier  <kevino@theolliviers.com>
    218
  • trunk/WebCore/page/FocusController.cpp

    r56057 r56311  
    362362        // |focusedNode|.
    363363        if (!((isInRootDocument(candidate) && !isInRootDocument(focusedNode))
    364             && closestFocusCandidate.node
    365             && focusedNode->document() == closestFocusCandidate.node->document())) {
     364            && focusedNode->document() == closestFocusCandidate.document())) {
    366365            closestFocusCandidate.node = candidate;
    367366            closestFocusCandidate.distance = distance;
  • trunk/WebCore/page/SpatialNavigation.cpp

    r56057 r56311  
    7777    RectsAlignment alignment = alignmentForRects(direction, curRect, targetRect);
    7878
    79     bool sameDocument = candidate.node && dest->document() == candidate.node->document();
     79    bool sameDocument = dest->document() == candidate.document();
    8080    if (sameDocument) {
    8181        if (candidate.alignment > alignment || (candidate.parentAlignment && alignment > candidate.parentAlignment))
     
    8686    // FIXME_tonikitoo: simplify the logic here !
    8787    if (alignment != None
    88         || (candidate.node && candidate.parentAlignment >= alignment
    89         && (candidate.node->document() == dest->document())
    90         && alignment > None)) {
     88        || (!candidate.isNull() && candidate.parentAlignment >= alignment
     89        && candidate.document() == dest->document())) {
    9190
    9291        // If we are now in an higher precedent case, lets reset the current |candidate|'s
Note: See TracChangeset for help on using the changeset viewer.