HTMLOutputElement.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. * Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibWeb/ARIA/Roles.h>
  9. #include <LibWeb/HTML/FormAssociatedElement.h>
  10. #include <LibWeb/HTML/HTMLElement.h>
  11. namespace Web::HTML {
  12. class HTMLOutputElement final
  13. : public HTMLElement
  14. , public FormAssociatedElement {
  15. WEB_PLATFORM_OBJECT(HTMLOutputElement, HTMLElement);
  16. FORM_ASSOCIATED_ELEMENT(HTMLElement, HTMLOutputElement)
  17. public:
  18. virtual ~HTMLOutputElement() override;
  19. DeprecatedString const& type() const
  20. {
  21. static DeprecatedString output = "output";
  22. return output;
  23. }
  24. // ^FormAssociatedElement
  25. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  26. virtual bool is_listed() const override { return true; }
  27. // https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize
  28. virtual bool is_resettable() const override { return true; }
  29. // https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize
  30. virtual bool is_auto_capitalize_inheriting() const override { return true; }
  31. // ^HTMLElement
  32. // https://html.spec.whatwg.org/multipage/forms.html#category-label
  33. virtual bool is_labelable() const override { return true; }
  34. virtual void reset_algorithm() override;
  35. // https://www.w3.org/TR/html-aria/#el-output
  36. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::status; }
  37. private:
  38. HTMLOutputElement(DOM::Document&, DOM::QualifiedName);
  39. virtual void initialize(JS::Realm&) override;
  40. };
  41. }