diff --git a/Libraries/LibWeb/HTML/HTMLDialogElement.cpp b/Libraries/LibWeb/HTML/HTMLDialogElement.cpp index 65034be43b7..b329793490a 100644 --- a/Libraries/LibWeb/HTML/HTMLDialogElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLDialogElement.cpp @@ -419,9 +419,17 @@ void HTMLDialogElement::close_the_dialog(Optional result, GC::Ptr(vm.argument(0).as_object()); @@ -434,7 +442,8 @@ void HTMLDialogElement::set_close_watcher() 0, Utf16FlyString {}, &realm()); auto cancel_callback = realm().heap().allocate(*cancel_callback_function, realm()); m_close_watcher->add_event_listener_without_options(HTML::EventNames::cancel, DOM::IDLEventListener::create(realm(), cancel_callback)); - // - closeAction being to close the dialog given dialog, dialog's request close return value, and dialog's request close source element. + // - closeAction being to close the dialog given dialog, dialog's request close return value, and dialog's + // request close source element. auto close_callback_function = JS::NativeFunction::create( realm(), [this](JS::VM&) { close_the_dialog(m_request_close_return_value, m_request_close_source_element); @@ -444,8 +453,9 @@ void HTMLDialogElement::set_close_watcher() 0, Utf16FlyString {}, &realm()); auto close_callback = realm().heap().allocate(*close_callback_function, realm()); m_close_watcher->add_event_listener_without_options(HTML::EventNames::close, DOM::IDLEventListener::create(realm(), close_callback)); - // - getEnabledState being to return true if dialog's enable close watcher for requestClose() is true or dialog's computed closed-by state is not None; otherwise false. - // ADHOC: Implemented slightly differently to the spec, as the spec is unnecessarily complex. + // - getEnabledState being to return true if dialog's enable close watcher for request close is true or dialog's + // computed closed-by state is not None; otherwise false. + // AD-HOC: Implemented slightly differently to the spec, as the spec is unnecessarily complex. // FIXME: This should be set based on dialog closedby state, when implemented. m_close_watcher->set_enabled(m_is_modal); }