mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Use the [Reflect] attribute to implement HTMLLinkElement.as
Also ensure that all valid potential destinations are allowed permitted.
This commit is contained in:
parent
aafc829e6d
commit
4ad8ba11d5
Notes:
github-actions[bot]
2024-11-29 08:49:55 +00:00
Author: https://github.com/tcl3
Commit: 4ad8ba11d5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2627
3 changed files with 29 additions and 21 deletions
|
@ -91,25 +91,6 @@ 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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue