Skip to content

Commit c899069

Browse files
committed
LibWeb: Add FIXME for moving "stop parsing" step for error documents
Corresponds to: whatwg/html@48cd393 Actually doing so was causing crashes and other issues, so I'll leave it as a FIXME for later.
1 parent 2feff2b commit c899069

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Libraries/LibWeb/DOM/DocumentLoading.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ GC::Ref<DOM::Document> create_document_for_inline_content(GC::Ptr<HTML::Navigabl
7878
// 5. Let document be the result of creating and initializing a Document object given "html", "text/html", and navigationParams.
7979
auto document = DOM::Document::create_and_initialize(DOM::Document::Type::HTML, "text/html"_string, navigation_params).release_value_but_fixme_should_propagate_errors();
8080

81-
// 6. Either associate document with a custom rendering that is not rendered using the normal Document rendering rules, or mutate document until it represents the content the
82-
// user agent wants to render.
81+
// 6. Either associate document with a custom rendering that is not rendered using the normal Document rendering
82+
// rules, or mutate document until it represents the content the user agent wants to render.
8383
mutate_document(*document);
8484

85-
// 7. Return document.
85+
// FIXME: 7. Act as if the user agent had stopped parsing document.
86+
// We currently do this in the caller instead, to avoid deadlocks.
87+
88+
// 8. Return document.
8689
return document;
8790
}
8891

Libraries/LibWeb/HTML/Navigable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ void Navigable::populate_session_history_entry_document(
14071407
document.set_url(URL::about_error());
14081408
parser->run();
14091409

1410-
// NOTE: Once the page has been set up, the user agent must act as if it had stopped parsing.
1410+
// FIXME: This should go in create_document_for_inline_content() instead.
14111411
// FIXME: Directly calling parser->the_end results in a deadlock, because it waits for the warning image to load.
14121412
// However the response is never processed when parser->the_end is called.
14131413
// Queuing a global task is a workaround for now.

0 commit comments

Comments
 (0)