HTMLDialogElement.h 826 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 HTMLDialogElement final : public HTMLElement {
  11. WEB_PLATFORM_OBJECT(HTMLDialogElement, HTMLElement);
  12. public:
  13. virtual ~HTMLDialogElement() override;
  14. String return_value() const;
  15. void set_return_value(String);
  16. void show();
  17. void show_modal();
  18. void close(Optional<String> return_value);
  19. // https://www.w3.org/TR/html-aria/#el-dialog
  20. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::dialog; }
  21. private:
  22. HTMLDialogElement(DOM::Document&, DOM::QualifiedName);
  23. virtual void initialize(JS::Realm&) override;
  24. String m_return_value;
  25. };
  26. }