mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
committed by
Andreas Kling
parent
aafc829e6d
commit
4ad8ba11d5
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user