1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 12:54:58 +00:00

LibWeb: Stub out HTMLDialogElement APIs

This makes https://null.com/ load instead of throwing a React internal
error and showing a black background.
This commit is contained in:
Andreas Kling 2023-09-02 19:23:04 +02:00
parent aa03f73c2e
commit e2dcd97c88
3 changed files with 43 additions and 0 deletions

View file

@ -22,4 +22,34 @@ void HTMLDialogElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLDialogElementPrototype>(realm, "HTMLDialogElement"));
}
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-show
void HTMLDialogElement::show()
{
dbgln("(STUBBED) HTMLDialogElement::show()");
}
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-showmodal
void HTMLDialogElement::show_modal()
{
dbgln("(STUBBED) HTMLDialogElement::show_modal()");
}
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-close
void HTMLDialogElement::close(Optional<String>)
{
dbgln("(STUBBED) HTMLDialogElement::close()");
}
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-returnvalue
String HTMLDialogElement::return_value() const
{
return m_return_value;
}
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-returnvalue
void HTMLDialogElement::set_return_value(String return_value)
{
m_return_value = move(return_value);
}
}