HTMLAnchorElement.cpp 846 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/HTMLAnchorElement.h>
  7. namespace Web::HTML {
  8. HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  9. : HTMLElement(document, move(qualified_name))
  10. {
  11. }
  12. HTMLAnchorElement::~HTMLAnchorElement()
  13. {
  14. }
  15. void HTMLAnchorElement::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 HTMLAnchorElement::hyperlink_element_utils_href() const
  23. {
  24. return attribute(HTML::AttributeNames::href);
  25. }
  26. void HTMLAnchorElement::set_hyperlink_element_utils_href(String href)
  27. {
  28. set_attribute(HTML::AttributeNames::href, move(href));
  29. }
  30. }