mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Use the correct document URL in DOMParser.parseFromString()
We were hard-coding "about:blank" as the document URL for parsed HTML documents, which was definitely not correct. This fixes a bunch of WPT tests under /domparsing/ :^)
This commit is contained in:
committed by
Andreas Kling
parent
323370dfa3
commit
55f58eea99
@@ -5415,8 +5415,7 @@ void Document::parse_html_from_a_string(StringView html)
|
||||
auto parser = HTML::HTMLParser::create(*this, html, "UTF-8"sv);
|
||||
|
||||
// 4. Start parser and let it run until it has consumed all the characters just inserted into the input stream.
|
||||
// FIXME: This is to match the default URL. Instead, pass in this's relevant global object's associated Document's URL.
|
||||
parser->run("about:blank"sv);
|
||||
parser->run(verify_cast<HTML::Window>(HTML::relevant_global_object(*this)).associated_document().url());
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe
|
||||
|
||||
Reference in New Issue
Block a user