1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Extract the (un)focus steps out of HTMLElement

The (un)focus steps have no dependency on HTMLElement, thus we can
extract them into their own file. This allows them to be called
anywhere.
This commit is contained in:
Luke Wilde 2022-11-05 14:30:49 +00:00 committed by Andreas Kling
parent c4ee43c5b4
commit 547e006a12
4 changed files with 300 additions and 260 deletions

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Optional.h>
#include <AK/String.h>
#include <LibWeb/Forward.h>
namespace Web::HTML {
void run_focusing_steps(DOM::Node* new_focus_target, DOM::Node* fallback_target = nullptr, Optional<String> focus_trigger = {});
void run_unfocusing_steps(DOM::Node* old_focus_target);
}