HTMLAreaElement.cpp 822 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/HTMLAreaElement.h>
  7. namespace Web::HTML {
  8. HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  9. : HTMLElement(document, move(qualified_name))
  10. {
  11. }
  12. HTMLAreaElement::~HTMLAreaElement() = default;
  13. void HTMLAreaElement::parse_attribute(FlyString const& name, String const& value)
  14. {
  15. HTMLElement::parse_attribute(name, value);
  16. if (name == HTML::AttributeNames::href) {
  17. set_the_url();
  18. }
  19. }
  20. String HTMLAreaElement::hyperlink_element_utils_href() const
  21. {
  22. return attribute(HTML::AttributeNames::href);
  23. }
  24. void HTMLAreaElement::set_hyperlink_element_utils_href(String href)
  25. {
  26. set_attribute(HTML::AttributeNames::href, move(href));
  27. }
  28. }