#include "third_party/blink/renderer/core/page/spatial_navigation_controller.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
#include "third_party/blink/public/mojom/scroll/scroll_into_view_params.mojom-blink.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/events/simulated_click_options.h"
#include "third_party/blink/renderer/core/dom/focus_params.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/events/web_input_event_conversion.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/html/forms/html_form_control_element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_frame_owner_element.h"
#include "third_party/blink/renderer/core/html/html_html_element.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/layout/hit_test_location.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/page/focus_controller.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/spatial_navigation.h"
#include "third_party/blink/renderer/core/scroll/scroll_into_view_util.h"
namespace blink {
namespace {
SpatialNavigationDirection FocusDirectionForKey(KeyboardEvent* event) { … }
void ClearFocusInExitedFrames(LocalFrame* old_frame,
const LocalFrame* const new_frame) { … }
bool IsSkippableCandidate(const Element* element) { … }
bool IsEqualDistanceAndContainsBestCandidate(
const FocusCandidate& candidate,
const FocusCandidate& best_candidate,
const double& candidate_distance,
const double& best_distance) { … }
static void ConsiderForBestCandidate(SpatialNavigationDirection direction,
const FocusCandidate& current_interest,
const FocusCandidate& candidate,
FocusCandidate* best_candidate,
double& best_distance,
FocusCandidate* previous_best_candidate,
double& previous_best_distance) { … }
}
SpatialNavigationController::SpatialNavigationController(Page& page)
: … { … }
bool SpatialNavigationController::HandleArrowKeyboardEvent(
KeyboardEvent* event) { … }
bool SpatialNavigationController::HandleEnterKeyboardEvent(
KeyboardEvent* event) { … }
void SpatialNavigationController::ResetEnterKeyState() { … }
bool SpatialNavigationController::HandleImeSubmitKeyboardEvent(
KeyboardEvent* event) { … }
bool SpatialNavigationController::HandleEscapeKeyboardEvent(
KeyboardEvent* event) { … }
void SpatialNavigationController::Trace(Visitor* visitor) const { … }
bool SpatialNavigationController::Advance(
SpatialNavigationDirection direction) { … }
FocusCandidate SpatialNavigationController::FindNextCandidateInContainer(
Node& container,
const PhysicalRect& starting_rect_in_root_frame,
SpatialNavigationDirection direction,
Node* interest_child_in_container) { … }
bool SpatialNavigationController::AdvanceWithinContainer(
Node& container,
const PhysicalRect& starting_rect_in_root_frame,
SpatialNavigationDirection direction,
Node* interest_child_in_container) { … }
Node* SpatialNavigationController::StartingNode() { … }
void SpatialNavigationController::MoveInterestTo(Node* next_node) { … }
void SpatialNavigationController::DispatchMouseMoveAt(Element* element) { … }
bool SpatialNavigationController::IsValidCandidate(
const Element* element) const { … }
Element* SpatialNavigationController::GetInterestedElement() const { … }
Element* SpatialNavigationController::GetFocusedElement() const { … }
}