/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2021, the SerenityOS developers. * Copyright (c) 2021, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::HTML { class HTMLLinkElement final : public HTMLElement , public ResourceClient { public: using WrapperType = Bindings::HTMLLinkElementWrapper; HTMLLinkElement(DOM::Document&, DOM::QualifiedName); virtual ~HTMLLinkElement() override; virtual void inserted() override; String rel() const { return attribute(HTML::AttributeNames::rel); } String type() const { return attribute(HTML::AttributeNames::type); } String href() const { return attribute(HTML::AttributeNames::href); } private: void parse_attribute(FlyString const&, String const&) override; // ^ResourceClient virtual void resource_did_fail() override; virtual void resource_did_load() override; struct Relationship { enum { Alternate = 1 << 0, Stylesheet = 1 << 1, Preload = 1 << 2, DNSPrefetch = 1 << 3, Preconnect = 1 << 4, }; }; RefPtr m_preload_resource; Optional m_document_load_event_delayer; unsigned m_relationship { 0 }; }; }