1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:18:12 +00:00

LibWeb: Move HTML classes into the Web::HTML namespace

This commit is contained in:
Andreas Kling 2020-07-28 18:20:36 +02:00
parent ebd2e7d9f5
commit c46439f240
82 changed files with 238 additions and 247 deletions

View file

@ -54,7 +54,7 @@ static RefPtr<DOM::Document> create_markdown_document(const ByteBuffer& data, co
if (!markdown_document)
return nullptr;
return parse_html_document(markdown_document->render_to_html(), url, "utf-8");
return HTML::parse_html_document(markdown_document->render_to_html(), url, "utf-8");
}
static RefPtr<DOM::Document> create_text_document(const ByteBuffer& data, const URL& url)
@ -116,7 +116,7 @@ static RefPtr<DOM::Document> create_gemini_document(const ByteBuffer& data, cons
{
auto markdown_document = Gemini::Document::parse({ (const char*)data.data(), data.size() }, url);
return parse_html_document(markdown_document->render_to_html(), url, "utf-8");
return HTML::parse_html_document(markdown_document->render_to_html(), url, "utf-8");
}
RefPtr<DOM::Document> FrameLoader::create_document_from_mime_type(const ByteBuffer& data, const URL& url, const String& mime_type, const String& encoding)
@ -130,7 +130,7 @@ RefPtr<DOM::Document> FrameLoader::create_document_from_mime_type(const ByteBuff
if (mime_type == "text/gemini")
return create_gemini_document(data, url);
if (mime_type == "text/html") {
HTMLDocumentParser parser(data, encoding);
HTML::HTMLDocumentParser parser(data, encoding);
parser.run(url);
return parser.document();
}
@ -189,7 +189,7 @@ void FrameLoader::load_error_page(const URL& failed_url, const String& error)
String::copy(data).characters(),
escape_html_entities(failed_url.to_string()).characters(),
escape_html_entities(error).characters());
auto document = parse_html_document(html, failed_url, "utf-8");
auto document = HTML::parse_html_document(html, failed_url, "utf-8");
ASSERT(document);
frame().set_document(document);
frame().page().client().page_did_change_title(document->title());