mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 08:52:54 +00:00
LibWeb: Added HTMLLinkElement.as
This commit is contained in:
parent
4b3e26c583
commit
2f4668edce
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/Hexeption
Commit: 2f4668edce
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/39
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/nico
5 changed files with 48 additions and 1 deletions
|
@ -90,6 +90,29 @@ void HTMLLinkElement::inserted()
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/semantics.html#dom-link-as
|
||||
String HTMLLinkElement::as() const
|
||||
{
|
||||
String attribute_value = get_attribute_value(HTML::AttributeNames::as);
|
||||
|
||||
if (attribute_value.equals_ignoring_ascii_case("fetch"sv) ||
|
||||
attribute_value.equals_ignoring_ascii_case("image"sv) ||
|
||||
attribute_value.equals_ignoring_ascii_case("script"sv) ||
|
||||
attribute_value.equals_ignoring_ascii_case("style"sv) ||
|
||||
attribute_value.equals_ignoring_ascii_case("video"sv) ||
|
||||
attribute_value.equals_ignoring_ascii_case("audio"sv) ||
|
||||
attribute_value.equals_ignoring_ascii_case("track"sv) ||
|
||||
attribute_value.equals_ignoring_ascii_case("font"sv))
|
||||
return attribute_value.to_lowercase().release_value();
|
||||
|
||||
return String {};
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> HTMLLinkElement::set_as(String const& value)
|
||||
{
|
||||
return set_attribute(HTML::AttributeNames::as, move(value));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/semantics.html#dom-link-rellist
|
||||
JS::NonnullGCPtr<DOM::DOMTokenList> HTMLLinkElement::rel_list()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue