2020-08-01 03:04:26 +01:00
|
|
|
/*
|
2021-04-28 22:46:44 +02:00
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
2020-08-01 03:04:26 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-08-01 03:04:26 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/HTML/HTMLAreaElement.h>
|
2022-08-28 13:42:07 +02:00
|
|
|
#include <LibWeb/HTML/Window.h>
|
2020-08-01 03:04:26 +01:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2022-02-18 21:00:52 +01:00
|
|
|
HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
2021-02-07 11:20:15 +01:00
|
|
|
: HTMLElement(document, move(qualified_name))
|
2020-08-01 03:04:26 +01:00
|
|
|
{
|
2022-09-25 16:38:21 -06:00
|
|
|
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLAreaElement"));
|
2020-08-01 03:04:26 +01:00
|
|
|
}
|
|
|
|
|
2022-03-14 13:21:51 -06:00
|
|
|
HTMLAreaElement::~HTMLAreaElement() = default;
|
2020-08-01 03:04:26 +01:00
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
void HTMLAreaElement::parse_attribute(FlyString const& name, DeprecatedString const& value)
|
2021-10-03 19:39:12 +02:00
|
|
|
{
|
|
|
|
HTMLElement::parse_attribute(name, value);
|
|
|
|
if (name == HTML::AttributeNames::href) {
|
|
|
|
set_the_url();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString HTMLAreaElement::hyperlink_element_utils_href() const
|
2021-10-03 19:39:12 +02:00
|
|
|
{
|
|
|
|
return attribute(HTML::AttributeNames::href);
|
|
|
|
}
|
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
void HTMLAreaElement::set_hyperlink_element_utils_href(DeprecatedString href)
|
2021-10-03 19:39:12 +02:00
|
|
|
{
|
2022-10-30 17:50:04 +00:00
|
|
|
MUST(set_attribute(HTML::AttributeNames::href, move(href)));
|
2021-10-03 19:39:12 +02:00
|
|
|
}
|
|
|
|
|
2022-11-05 03:58:14 +00:00
|
|
|
// https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex
|
|
|
|
i32 HTMLAreaElement::default_tab_index_value() const
|
|
|
|
{
|
|
|
|
// See the base function for the spec comments.
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-01 03:04:26 +01:00
|
|
|
}
|