|
@@ -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()
|
|
|
{
|