HTMLAreaElement.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/HTMLAreaElement.h>
  7. #include <LibWeb/HTML/Window.h>
  8. namespace Web::HTML {
  9. HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  10. : HTMLElement(document, move(qualified_name))
  11. {
  12. set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLAreaElement"));
  13. }
  14. HTMLAreaElement::~HTMLAreaElement() = default;
  15. void HTMLAreaElement::parse_attribute(FlyString const& name, DeprecatedString const& value)
  16. {
  17. HTMLElement::parse_attribute(name, value);
  18. if (name == HTML::AttributeNames::href) {
  19. set_the_url();
  20. }
  21. }
  22. DeprecatedString HTMLAreaElement::hyperlink_element_utils_href() const
  23. {
  24. return attribute(HTML::AttributeNames::href);
  25. }
  26. void HTMLAreaElement::set_hyperlink_element_utils_href(DeprecatedString href)
  27. {
  28. MUST(set_attribute(HTML::AttributeNames::href, move(href)));
  29. }
  30. // https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex
  31. i32 HTMLAreaElement::default_tab_index_value() const
  32. {
  33. // See the base function for the spec comments.
  34. return 0;
  35. }
  36. }