mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-07 19:52:55 +00:00
LibWeb: Bring up basic external script execution in the new parser
This only works in some narrow cases, but should be enough for our own welcome.html at least. :^)
This commit is contained in:
parent
2cb50f6750
commit
4c9c6b3a7b
Notes:
sideshowbarker
2024-07-19 06:03:49 +09:00
Author: https://github.com/awesomekling
Commit: 4c9c6b3a7b
7 changed files with 60 additions and 3 deletions
|
@ -704,8 +704,48 @@ void HTMLDocumentParser::handle_text(HTMLToken& token)
|
|||
if (script_nesting_level() == 0)
|
||||
m_parser_pause_flag = false;
|
||||
// FIXME: Handle tokenizer insertion point stuff here too.
|
||||
|
||||
while (document().pending_parsing_blocking_script()) {
|
||||
if (script_nesting_level() != 0) {
|
||||
m_parser_pause_flag = true;
|
||||
// FIXME: Abort the processing of any nested invocations of the tokenizer,
|
||||
// yielding control back to the caller. (Tokenization will resume when
|
||||
// the caller returns to the "outer" tree construction stage.)
|
||||
TODO();
|
||||
} else {
|
||||
auto the_script = document().take_pending_parsing_blocking_script({});
|
||||
m_tokenizer.set_blocked(true);
|
||||
|
||||
// FIXME: If the parser's Document has a style sheet that is blocking scripts
|
||||
// or the script's "ready to be parser-executed" flag is not set:
|
||||
// spin the event loop until the parser's Document has no style sheet
|
||||
// that is blocking scripts and the script's "ready to be parser-executed"
|
||||
// flag is set.
|
||||
|
||||
ASSERT(the_script->is_ready_to_be_parser_executed());
|
||||
|
||||
if (m_aborted)
|
||||
return;
|
||||
|
||||
m_tokenizer.set_blocked(false);
|
||||
|
||||
// FIXME: Handle tokenizer insertion point stuff here too.
|
||||
|
||||
ASSERT(script_nesting_level() == 0);
|
||||
increment_script_nesting_level();
|
||||
|
||||
the_script->execute_script();
|
||||
|
||||
decrement_script_nesting_level();
|
||||
ASSERT(script_nesting_level() == 0);
|
||||
m_parser_pause_flag = false;
|
||||
|
||||
// FIXME: Handle tokenizer insertion point stuff here too.
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (token.is_end_tag()) {
|
||||
m_stack_of_open_elements.pop();
|
||||
m_insertion_mode = m_original_insertion_mode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue