1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

LibWeb+Browser: Remove old HTML parser :^)

The new parser is now used everywhere and it's working pretty well!
This commit is contained in:
Andreas Kling 2020-06-25 23:50:35 +02:00
parent 6c783dbf62
commit 6293d1a13c
9 changed files with 1 additions and 560 deletions

View file

@ -28,6 +28,7 @@
#include <LibGemini/Document.h>
#include <LibGfx/ImageDecoder.h>
#include <LibMarkdown/Document.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/Text.h>
#include <LibWeb/Frame/Frame.h>
@ -35,7 +36,6 @@
#include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page.h>
#include <LibWeb/Parser/HTMLDocumentParser.h>
#include <LibWeb/Parser/HTMLParser.h>
namespace Web {
@ -130,8 +130,6 @@ RefPtr<Document> FrameLoader::create_document_from_mime_type(const ByteBuffer& d
if (mime_type == "text/gemini")
return create_gemini_document(data, url);
if (mime_type == "text/html") {
if (m_use_old_parser)
return parse_html_document(data, url, encoding);
HTMLDocumentParser parser(data, encoding);
parser.run(url);
return parser.document();

View file

@ -43,8 +43,6 @@ public:
Frame& frame() { return m_frame; }
const Frame& frame() const { return m_frame; }
void set_use_old_parser(bool b) { m_use_old_parser = b; }
private:
// ^ResourceClient
virtual void resource_did_load() override;
@ -54,8 +52,6 @@ private:
RefPtr<Document> create_document_from_mime_type(const ByteBuffer&, const URL&, const String& mime_type, const String& encoding);
Frame& m_frame;
bool m_use_old_parser { false };
};
}