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

LibWeb: Begin work on a spec-compliant HTML parser

In order to actually view the web as it is, we're gonna need a proper
HTML parser. So let's build one!

This patch introduces the Web::HTMLTokenizer class, which currently
operates on a StringView input stream where it fetches (ASCII only atm)
codepoints and tokenizes acccording to the HTML spec tokenization algo.

The tokenizer state machine looks a bit weird but is written in a way
that tries to mimic the spec as closely as possible, in order to make
development easier and bugs less likely.

This initial version is far from finished, but it can parse a trivial
document with a DOCTYPE and open/close tags. :^)
This commit is contained in:
Andreas Kling 2020-05-22 21:46:13 +02:00
parent 120cd44011
commit 272b35d2e1
7 changed files with 562 additions and 0 deletions

View file

@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
</html>