mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 02:44:58 +00:00
LibWeb+Browser: Use the new HTML parser by default
You can still run the old parser with "br -O", but the new one is good enough to be the default parser now. We'll fix issues as we go and eventually remove the old one completely. :^)
This commit is contained in:
parent
517cf65c99
commit
8766e49a7c
5 changed files with 13 additions and 14 deletions
|
@ -44,9 +44,9 @@
|
|||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/Frame.h>
|
||||
#include <LibWeb/PageView.h>
|
||||
#include <LibWeb/Layout/LayoutDocument.h>
|
||||
#include <LibWeb/Layout/LayoutNode.h>
|
||||
#include <LibWeb/PageView.h>
|
||||
#include <LibWeb/Parser/HTMLDocumentParser.h>
|
||||
#include <LibWeb/Parser/HTMLParser.h>
|
||||
#include <LibWeb/RenderingContext.h>
|
||||
|
@ -443,12 +443,11 @@ RefPtr<Document> 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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue