mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 00:38:48 +00:00
LibWeb: Make EventTarget::activation_behavior a virtual function
(Instead of using an AK::Function on EventTarget). This shaves 48 bytes off of every EventTarget instance.
This commit is contained in:
parent
84eecbb10e
commit
a71eaefdf6
Notes:
sideshowbarker
2024-07-18 08:59:31 +09:00
Author: https://github.com/awesomekling
Commit: a71eaefdf6
Pull-request: https://github.com/SerenityOS/serenity/pull/21991
11 changed files with 108 additions and 64 deletions
|
@ -16,9 +16,6 @@ JS_DEFINE_ALLOCATOR(HTMLAnchorElement);
|
|||
HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: HTMLElement(document, move(qualified_name))
|
||||
{
|
||||
activation_behavior = [this](auto const& event) {
|
||||
run_activation_behavior(event);
|
||||
};
|
||||
}
|
||||
|
||||
HTMLAnchorElement::~HTMLAnchorElement() = default;
|
||||
|
@ -47,7 +44,12 @@ WebIDL::ExceptionOr<void> HTMLAnchorElement::set_hyperlink_element_utils_href(St
|
|||
return set_attribute(HTML::AttributeNames::href, move(href));
|
||||
}
|
||||
|
||||
void HTMLAnchorElement::run_activation_behavior(Web::DOM::Event const&)
|
||||
bool HTMLAnchorElement::has_activation_behavior() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void HTMLAnchorElement::activation_behavior(Web::DOM::Event const&)
|
||||
{
|
||||
// The activation behavior of an a element element given an event event is:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue