LibWeb: Introduce the Environment Settings Object

The environment settings object is effectively the context a piece of
script is running under, for example, it contains the origin,
responsible document, realm, global object and event loop for the
current context. This effectively replaces ScriptExecutionContext, but
it cannot be removed in this commit as EventTarget still depends on it.

https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
This commit is contained in:
Luke Wilde 2021-10-14 16:12:53 +01:00 committed by Linus Groh
parent 4db5406d62
commit f71f404e0c
Notes: sideshowbarker 2024-07-17 19:09:28 +09:00
29 changed files with 883 additions and 86 deletions

View file

@ -222,7 +222,7 @@ void HTMLParser::the_end()
}
// 6. Queue a global task on the DOM manipulation task source given the Document's relevant global object to run the following substeps:
queue_global_task(HTML::Task::Source::DOMManipulation, *m_document, [document = m_document]() mutable {
old_queue_global_task_with_document(HTML::Task::Source::DOMManipulation, m_document, [document = m_document]() mutable {
// FIXME: 1. Set the Document's load timing info's DOM content loaded event start time to the current high resolution time given the Document's relevant global object.
// 2. Fire an event named DOMContentLoaded at the Document object, with its bubbles attribute initialized to true.
@ -249,7 +249,7 @@ void HTMLParser::the_end()
});
// 9. Queue a global task on the DOM manipulation task source given the Document's relevant global object to run the following steps:
queue_global_task(HTML::Task::Source::DOMManipulation, *m_document, [document = m_document]() mutable {
old_queue_global_task_with_document(HTML::Task::Source::DOMManipulation, m_document, [document = m_document]() mutable {
// 1. Update the current document readiness to "complete".
document->update_readiness(HTML::DocumentReadyState::Complete);