mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-25 09:30:01 +00:00
LibWeb: Avoid including Navigable.h in headers
This greatly reduces how much is recompiled when changing Navigable.h, from >1000 to 82.
This commit is contained in:
parent
7bccd65b4a
commit
eeb5446c1b
Notes:
github-actions[bot]
2025-10-20 09:18:20 +00:00
Author: https://github.com/Lubrsi
Commit: eeb5446c1b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6491
Reviewed-by: https://github.com/AtkinsSJ ✅
55 changed files with 170 additions and 64 deletions
26
Libraries/LibWeb/HTML/UserNavigationInvolvement.cpp
Normal file
26
Libraries/LibWeb/HTML/UserNavigationInvolvement.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <andrew@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/HTML/UserNavigationInvolvement.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#event-uni
|
||||
UserNavigationInvolvement user_navigation_involvement(DOM::Event const& event)
|
||||
{
|
||||
// For convenience at certain call sites, the user navigation involvement for an Event event is defined as follows:
|
||||
|
||||
// 1. Assert: this algorithm is being called as part of an activation behavior definition.
|
||||
// 2. Assert: event's type is "click".
|
||||
VERIFY(event.type() == "click"_fly_string);
|
||||
|
||||
// 3. If event's isTrusted is initialized to true, then return "activation".
|
||||
// 4. Return "none".
|
||||
return event.is_trusted() ? UserNavigationInvolvement::Activation : UserNavigationInvolvement::None;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue