mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibHTML: Optionally pass document URL to the HTML parser
This makes the document URL available to all the parse_attributes() callbacks, in case they need it for anything.
This commit is contained in:
@@ -72,11 +72,12 @@ static bool is_self_closing_tag(const String& tag_name)
|
||||
|| tag_name == "wbr";
|
||||
}
|
||||
|
||||
NonnullRefPtr<Document> parse_html(const String& html)
|
||||
NonnullRefPtr<Document> parse_html(const String& html, const URL& url)
|
||||
{
|
||||
NonnullRefPtrVector<ParentNode> node_stack;
|
||||
|
||||
auto document = adopt(*new Document);
|
||||
document->set_url(url);
|
||||
node_stack.append(document);
|
||||
|
||||
enum class State {
|
||||
|
||||
Reference in New Issue
Block a user