HTMLAreaElement.cpp 1014 B

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