HTMLDialogElement.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. HTMLDialogElement::HTMLDialogElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  10. : HTMLElement(document, move(qualified_name))
  11. {
  12. }
  13. HTMLDialogElement::~HTMLDialogElement() = default;
  14. void HTMLDialogElement::initialize(JS::Realm& realm)
  15. {
  16. Base::initialize(realm);
  17. set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDialogElementPrototype>(realm, "HTMLDialogElement"));
  18. }
  19. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-show
  20. void HTMLDialogElement::show()
  21. {
  22. dbgln("(STUBBED) HTMLDialogElement::show()");
  23. }
  24. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-showmodal
  25. void HTMLDialogElement::show_modal()
  26. {
  27. dbgln("(STUBBED) HTMLDialogElement::show_modal()");
  28. }
  29. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-close
  30. void HTMLDialogElement::close(Optional<String>)
  31. {
  32. dbgln("(STUBBED) HTMLDialogElement::close()");
  33. }
  34. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-returnvalue
  35. String HTMLDialogElement::return_value() const
  36. {
  37. return m_return_value;
  38. }
  39. // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-returnvalue
  40. void HTMLDialogElement::set_return_value(String return_value)
  41. {
  42. m_return_value = move(return_value);
  43. }
  44. }