HTMLAreaElement.cpp 924 B

1234567891011121314151617181920212223242526272829303132333435363738
  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(&window().cached_web_prototype("HTMLAreaElement"));
  13. }
  14. HTMLAreaElement::~HTMLAreaElement() = default;
  15. void HTMLAreaElement::parse_attribute(FlyString const& name, String const& value)
  16. {
  17. HTMLElement::parse_attribute(name, value);
  18. if (name == HTML::AttributeNames::href) {
  19. set_the_url();
  20. }
  21. }
  22. String HTMLAreaElement::hyperlink_element_utils_href() const
  23. {
  24. return attribute(HTML::AttributeNames::href);
  25. }
  26. void HTMLAreaElement::set_hyperlink_element_utils_href(String href)
  27. {
  28. set_attribute(HTML::AttributeNames::href, move(href));
  29. }
  30. }