Преглед изворни кода

LibHTML: Rename parse_html() => parse_html_document()

Andreas Kling пре 5 година
родитељ
комит
794f2d5645

+ 1 - 1
Applications/Help/main.cpp

@@ -80,7 +80,7 @@ int main(int argc, char* argv[])
         ASSERT(success);
 
         String html = md_document.render_to_html();
-        auto html_document = parse_html(html);
+        auto html_document = parse_html_document(html);
         html_view->set_document(html_document);
 
         String page_and_section = model->page_and_section(tree_view->selection().first());

+ 1 - 1
DevTools/HackStudio/Editor.cpp

@@ -121,7 +121,7 @@ void Editor::show_documentation_tooltip_if_available(const String& hovered_token
 
     auto html_text = man_document.render_to_html();
 
-    auto html_document = parse_html(html_text);
+    auto html_document = parse_html_document(html_text);
     if (!html_document) {
         dbg() << "failed to parse HTML";
         return;

+ 1 - 1
Libraries/LibHTML/HtmlView.cpp

@@ -314,7 +314,7 @@ void HtmlView::load(const URL& url)
         if (url.path().ends_with(".png")) {
             document = create_image_document(data, url);
         } else {
-            document = parse_html(data, url);
+            document = parse_html_document(data, url);
         }
         ASSERT(document);
         set_document(document);

+ 4 - 4
Libraries/LibHTML/Parser/HTMLParser.cpp

@@ -34,7 +34,7 @@ static bool is_self_closing_tag(const StringView& tag_name)
         || tag_name == "wbr";
 }
 
-static bool parse_html(const StringView& html, Document& document, ParentNode& root)
+static bool parse_html_document(const StringView& html, Document& document, ParentNode& root)
 {
     NonnullRefPtrVector<ParentNode> node_stack;
     node_stack.append(root);
@@ -313,17 +313,17 @@ static bool parse_html(const StringView& html, Document& document, ParentNode& r
 RefPtr<DocumentFragment> parse_html_fragment(Document& document, const StringView& html)
 {
     auto fragment = adopt(*new DocumentFragment(document));
-    if (!parse_html(html, document, *fragment))
+    if (!parse_html_document(html, document, *fragment))
         return nullptr;
     return fragment;
 }
 
-NonnullRefPtr<Document> parse_html(const StringView& html, const URL& url)
+NonnullRefPtr<Document> parse_html_document(const StringView& html, const URL& url)
 {
     auto document = adopt(*new Document);
     document->set_url(url);
 
-    bool success = parse_html(html, *document, *document);
+    bool success = parse_html_document(html, *document, *document);
     ASSERT(success);
 
     document->fixup();

+ 1 - 1
Libraries/LibHTML/Parser/HTMLParser.h

@@ -5,5 +5,5 @@
 
 class DocumentFragment;
 
-NonnullRefPtr<Document> parse_html(const StringView&, const URL& = URL());
+NonnullRefPtr<Document> parse_html_document(const StringView&, const URL& = URL());
 RefPtr<DocumentFragment> parse_html_fragment(Document&, const StringView&);

+ 1 - 1
Userland/html.cpp

@@ -34,7 +34,7 @@ int main(int argc, char** argv)
     }
 
     String html = String::copy(f->read_all());
-    auto document = parse_html(html);
+    auto document = parse_html_document(html);
 
     auto window = GWindow::construct();
     auto widget = HtmlView::construct();