diff --git a/Applications/Browser/Tab.cpp b/Applications/Browser/Tab.cpp index b404fe846c..73d8506211 100644 --- a/Applications/Browser/Tab.cpp +++ b/Applications/Browser/Tab.cpp @@ -59,7 +59,7 @@ namespace Browser { -extern bool g_use_new_html_parser; +extern bool g_use_old_html_parser; extern String g_home_url; Tab::Tab() @@ -71,7 +71,7 @@ Tab::Tab() auto& toolbar = m_toolbar_container->add(); m_page_view = widget.add(); - m_page_view->set_use_new_parser(g_use_new_html_parser); + m_page_view->set_use_old_parser(g_use_old_html_parser); m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { m_history.go_back(); diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp index 50257828d3..35f3c166b8 100644 --- a/Applications/Browser/main.cpp +++ b/Applications/Browser/main.cpp @@ -45,7 +45,7 @@ namespace Browser { static const char* bookmarks_filename = "/home/anon/bookmarks.json"; String g_home_url; -bool g_use_new_html_parser = false; +bool g_use_old_html_parser = false; } @@ -64,7 +64,7 @@ int main(int argc, char** argv) const char* specified_url = nullptr; Core::ArgsParser args_parser; - args_parser.add_option(Browser::g_use_new_html_parser, "Use new HTML parser", "new-parser", 'n'); + args_parser.add_option(Browser::g_use_old_html_parser, "Use old HTML parser", "old-parser", 'O'); args_parser.add_positional_argument(specified_url, "URL to open", "url", Core::ArgsParser::Required::No); args_parser.parse(argc, argv); diff --git a/Libraries/LibWeb/PageView.cpp b/Libraries/LibWeb/PageView.cpp index 88304be1b5..02af758924 100644 --- a/Libraries/LibWeb/PageView.cpp +++ b/Libraries/LibWeb/PageView.cpp @@ -44,9 +44,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -443,12 +443,11 @@ RefPtr PageView::create_document_from_mime_type(const ByteBuffer& data if (mime_type == "text/gemini") return create_gemini_document(data, url); if (mime_type == "text/html") { - if (m_use_new_parser) { - HTMLDocumentParser parser(data, encoding); - parser.run(url); - return parser.document(); - } - return parse_html_document(data, url, encoding); + if (m_use_old_parser) + return parse_html_document(data, url, encoding); + HTMLDocumentParser parser(data, encoding); + parser.run(url); + return parser.document(); } return nullptr; } diff --git a/Libraries/LibWeb/PageView.h b/Libraries/LibWeb/PageView.h index 200e12ea05..4151448e4e 100644 --- a/Libraries/LibWeb/PageView.h +++ b/Libraries/LibWeb/PageView.h @@ -40,7 +40,7 @@ public: virtual ~PageView() override; // FIXME: Remove this once the new parser is ready. - void set_use_new_parser(bool use_new_parser) { m_use_new_parser = use_new_parser; } + void set_use_old_parser(bool use_old_parser) { m_use_old_parser = use_old_parser; } Document* document(); const Document* document() const; @@ -99,7 +99,7 @@ private: bool m_should_show_line_box_borders { false }; bool m_in_mouse_selection { false }; - bool m_use_new_parser { false }; + bool m_use_old_parser { false }; }; } diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index 773b34454f..cd25d9d470 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define PARSER_DEBUG +//#define PARSER_DEBUG #include #include