HTMLDialogElement.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Bindings/Intrinsics.h>
  7. #include <LibWeb/HTML/HTMLDialogElement.h>
  8. namespace Web::HTML {
  9. JS_DEFINE_ALLOCATOR(HTMLDialogElement);
  10. HTMLDialogElement::HTMLDialogElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  11. : HTMLElement(document, move(qualified_name))
  12. {
  13. }
  14. HTMLDialogElement::~HTMLDialogElement() = default;
  15. void HTMLDialogElement::initialize(JS::Realm& realm)
  16. {
  17. Base::initialize(realm);
  18. set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDialogElementPrototype>(realm, "HTMLDialogElement"_fly_string));
  19. }
  20. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-show
  21. void HTMLDialogElement::show()
  22. {
  23. dbgln("(STUBBED) HTMLDialogElement::show()");
  24. }
  25. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-showmodal
  26. void HTMLDialogElement::show_modal()
  27. {
  28. dbgln("(STUBBED) HTMLDialogElement::show_modal()");
  29. }
  30. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-close
  31. void HTMLDialogElement::close(Optional<String>)
  32. {
  33. dbgln("(STUBBED) HTMLDialogElement::close()");
  34. }
  35. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-returnvalue
  36. String HTMLDialogElement::return_value() const
  37. {
  38. return m_return_value;
  39. }
  40. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-returnvalue
  41. void HTMLDialogElement::set_return_value(String return_value)
  42. {
  43. m_return_value = move(return_value);
  44. }
  45. }