mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 03:02:55 +00:00
LibHTML: Add basic <!DOCTYPE> parsing and a DocumentType class
Plus, Document::fixup() will now make sure that the document always starts with a doctype node, followed by an <html> element.
This commit is contained in:
parent
850955053f
commit
fc53867937
Notes:
sideshowbarker
2024-07-19 11:44:42 +09:00
Author: https://github.com/awesomekling
Commit: fc53867937
9 changed files with 84 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <AK/Utf8View.h>
|
||||
#include <LibHTML/CSS/StyleSheet.h>
|
||||
#include <LibHTML/DOM/Document.h>
|
||||
#include <LibHTML/DOM/DocumentType.h>
|
||||
#include <LibHTML/DOM/Element.h>
|
||||
#include <LibHTML/DOM/Text.h>
|
||||
#include <LibHTML/Dump.h>
|
||||
|
@ -24,6 +25,8 @@ void dump_tree(const Node& node)
|
|||
dbgprintf(">\n");
|
||||
} else if (is<Text>(node)) {
|
||||
dbgprintf("\"%s\"\n", static_cast<const Text&>(node).data().characters());
|
||||
} else if (is<DocumentType>(node)) {
|
||||
dbgprintf("<!DOCTYPE>\n");
|
||||
}
|
||||
++indent;
|
||||
if (is<ParentNode>(node)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue