HTMLSummaryElement.h 865 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/ARIA/Roles.h>
  8. #include <LibWeb/HTML/HTMLElement.h>
  9. namespace Web::HTML {
  10. class HTMLSummaryElement final : public HTMLElement {
  11. WEB_PLATFORM_OBJECT(HTMLSummaryElement, HTMLElement);
  12. JS_DECLARE_ALLOCATOR(HTMLSummaryElement);
  13. public:
  14. virtual ~HTMLSummaryElement() override;
  15. // https://www.w3.org/TR/html-aria/#el-details
  16. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::button; }
  17. bool is_summary_for_its_parent_details();
  18. virtual bool has_activation_behavior() const override;
  19. virtual void activation_behavior(DOM::Event const&) override;
  20. private:
  21. HTMLSummaryElement(DOM::Document&, DOM::QualifiedName);
  22. virtual void initialize(JS::Realm&) override;
  23. };
  24. }