Index: Source/core/page/FocusController.cpp |
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp |
index 6ca0a1a66b1995e3d9249fe66710ae259695830d..cace7b16a7bb85207a7b3ccf867b8b7f11dd2635 100644 |
--- a/Source/core/page/FocusController.cpp |
+++ b/Source/core/page/FocusController.cpp |
@@ -767,9 +767,8 @@ static void updateFocusCandidateIfNeeded(FocusDirection direction, const FocusCa |
closest = candidate; |
} |
-void FocusController::findFocusCandidateInContainer(Node* container, const LayoutRect& startingRect, FocusDirection direction, FocusCandidate& closest) |
+void FocusController::findFocusCandidateInContainer(Node& container, const LayoutRect& startingRect, FocusDirection direction, FocusCandidate& closest) |
{ |
- ASSERT(container); |
Element* focusedElement = (focusedFrame() && focusedFrame()->document()) ? focusedFrame()->document()->focusedElement() : 0; |
Element* element = ElementTraversal::firstWithin(container); |
@@ -779,8 +778,8 @@ void FocusController::findFocusCandidateInContainer(Node* container, const Layou |
current.visibleNode = focusedElement; |
for (; element; element = (element->isFrameOwnerElement() || canScrollInDirection(element, direction)) |
- ? ElementTraversal::nextSkippingChildren(*element, container) |
- : ElementTraversal::next(*element, container)) { |
+ ? ElementTraversal::nextSkippingChildren(*element, &container) |
+ : ElementTraversal::next(*element, &container)) { |
if (element == focusedElement) |
continue; |
@@ -791,7 +790,7 @@ void FocusController::findFocusCandidateInContainer(Node* container, const Layou |
if (candidate.isNull()) |
continue; |
- candidate.enclosingScrollableBox = container; |
+ candidate.enclosingScrollableBox = &container; |
updateFocusCandidateIfNeeded(direction, current, candidate, closest); |
} |
} |
@@ -808,7 +807,7 @@ bool FocusController::advanceFocusDirectionallyInContainer(Node* container, cons |
// Find the closest node within current container in the direction of the navigation. |
FocusCandidate focusCandidate; |
- findFocusCandidateInContainer(container, newStartingRect, direction, focusCandidate); |
+ findFocusCandidateInContainer(*container, newStartingRect, direction, focusCandidate); |
if (focusCandidate.isNull()) { |
// Nothing to focus, scroll if possible. |