HTMLAnchorElement.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/HTML/HTMLElement.h>
  8. #include <LibWeb/HTML/HTMLHyperlinkElementUtils.h>
  9. namespace Web::HTML {
  10. class HTMLAnchorElement final
  11. : public HTMLElement
  12. , public HTMLHyperlinkElementUtils {
  13. public:
  14. using WrapperType = Bindings::HTMLAnchorElementWrapper;
  15. HTMLAnchorElement(DOM::Document&, DOM::QualifiedName);
  16. virtual ~HTMLAnchorElement() override;
  17. String target() const { return attribute(HTML::AttributeNames::target); }
  18. virtual bool is_focusable() const override { return has_attribute(HTML::AttributeNames::href); }
  19. private:
  20. // ^DOM::Element
  21. virtual void parse_attribute(FlyString const& name, String const& value) override;
  22. // ^HTML::HTMLHyperlinkElementUtils
  23. virtual DOM::Document const& hyperlink_element_utils_document() const override { return document(); }
  24. virtual String hyperlink_element_utils_href() const override;
  25. virtual void set_hyperlink_element_utils_href(String) override;
  26. };
  27. }