OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 if (candidate.isNull()) | 781 if (candidate.isNull()) |
782 continue; | 782 continue; |
783 | 783 |
784 candidate.enclosingScrollableBox = container; | 784 candidate.enclosingScrollableBox = container; |
785 updateFocusCandidateIfNeeded(direction, current, candidate, closest); | 785 updateFocusCandidateIfNeeded(direction, current, candidate, closest); |
786 } | 786 } |
787 } | 787 } |
788 | 788 |
789 bool FocusController::advanceFocusDirectionallyInContainer(Node* container, cons
t LayoutRect& startingRect, FocusDirection direction) | 789 bool FocusController::advanceFocusDirectionallyInContainer(Node* container, cons
t LayoutRect& startingRect, FocusDirection direction) |
790 { | 790 { |
791 if (!container || !container->document()) | 791 if (!container) |
792 return false; | 792 return false; |
793 | 793 |
794 LayoutRect newStartingRect = startingRect; | 794 LayoutRect newStartingRect = startingRect; |
795 | 795 |
796 if (startingRect.isEmpty()) | 796 if (startingRect.isEmpty()) |
797 newStartingRect = virtualRectForDirection(direction, nodeRectInAbsoluteC
oordinates(container)); | 797 newStartingRect = virtualRectForDirection(direction, nodeRectInAbsoluteC
oordinates(container)); |
798 | 798 |
799 // Find the closest node within current container in the direction of the na
vigation. | 799 // Find the closest node within current container in the direction of the na
vigation. |
800 FocusCandidate focusCandidate; | 800 FocusCandidate focusCandidate; |
801 findFocusCandidateInContainer(container, newStartingRect, direction, focusCa
ndidate); | 801 findFocusCandidateInContainer(container, newStartingRect, direction, focusCa
ndidate); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); | 890 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); |
891 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct
ion, container); | 891 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(direct
ion, container); |
892 if (container && container->isDocumentNode()) | 892 if (container && container->isDocumentNode()) |
893 toDocument(container)->updateLayoutIgnorePendingStylesheets(); | 893 toDocument(container)->updateLayoutIgnorePendingStylesheets(); |
894 } while (!consumed && container); | 894 } while (!consumed && container); |
895 | 895 |
896 return consumed; | 896 return consumed; |
897 } | 897 } |
898 | 898 |
899 } // namespace WebCore | 899 } // namespace WebCore |
OLD | NEW |