Changeset 57921 in webkit


Ignore:
Timestamp:
Apr 20, 2010 2:32:24 PM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

Spatial Navigation: at @updateFocusCandidateIfCloser make an assignment shortcut when FocusCandidate is null
https://bugs.webkit.org/show_bug.cgi?id=37802

Reviewed by Simon Fraser.
Patch by Antonio Gomes <tonikitoo@webkit.org>

In updateFocusCandidateIfCloser method, we do all bail out checks in the begining of
the method body. If after those bail out checks, no "best FocusCandidate" has been taken
yet (i.e. focusCandidate.isNull() == true), we can safely take the current candidate,
and exit earlier.

No behavior change, it is just a safe assignment shortcut.

  • page/FocusController.cpp:

(WebCore::updateFocusCandidateIfCloser):

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57919 r57921  
     12010-04-19  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Spatial Navigation: at @updateFocusCandidateIfCloser make an assignment shortcut when FocusCandidate is null
     6        https://bugs.webkit.org/show_bug.cgi?id=37802
     7
     8        In updateFocusCandidateIfCloser method, we do all bail out checks in the begining of
     9        the method body. If after those bail out checks, no "best FocusCandidate" has been taken
     10        yet (i.e. focusCandidate.isNull() == true), we can safely take the current candidate,
     11        and exit earlier.
     12
     13        No behavior change, it is just a safe assignment shortcut.
     14
     15        * page/FocusController.cpp:
     16        (WebCore::updateFocusCandidateIfCloser):
     17
    1182010-04-20  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/WebCore/page/FocusController.cpp

    r57662 r57921  
    370370        return;
    371371
     372    if (closest.isNull()) {
     373        closest = candidate;
     374        return;
     375    }
     376
    372377    // If the focused node and the candadate are in the same document and current
    373378    // closest candidate is not in an {i}frame that is preferable to get focused ...
Note: See TracChangeset for help on using the changeset viewer.