LibWeb: Support Document.onreadystatechange

This is just a standard IDL event attribute handler.

Fixes at least one WPT test:
https://wpt.live/html/dom/documents/resource-metadata-management/document-readyState.html
This commit is contained in:
Andreas Kling 2024-10-08 16:24:23 +02:00 committed by Andreas Kling
commit 26be8f865a
Notes: github-actions[bot] 2024-10-08 16:50:11 +00:00
5 changed files with 28 additions and 0 deletions

View file

@ -5666,4 +5666,14 @@ Document::StepsToFireBeforeunloadResult Document::steps_to_fire_beforeunload(boo
return { unload_prompt_shown, unload_prompt_canceled };
}
WebIDL::CallbackType* Document::onreadystatechange()
{
return event_handler_attribute(HTML::EventNames::readystatechange);
}
void Document::set_onreadystatechange(WebIDL::CallbackType* value)
{
set_event_handler_attribute(HTML::EventNames::readystatechange, value);
}
}