Commit Graph

6 Commits

Author SHA1 Message Date
Andreas Kling
53d2f4df70 LibWeb: Factor out the "stack of open elements" into its own class
This will allow us to write more expressive parsing code. :^)
2020-05-24 23:54:22 +02:00
Andreas Kling
fd1b31d0ff LibWeb: Start building the tree building part of the new HTML parser
This patch adds a new HTMLDocumentParser class. It keeps a tokenizer
object internally and feeds itself with one token at a time from it.

The names and idioms in this class are expressed as closely to the
actual HTML parsing spec as possible, to make development as easy
and bug free as possible. :^)

This is going to become pretty large, but it's pretty cool!
2020-05-24 00:14:23 +02:00
Andreas Kling
272b35d2e1 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. :^)
2020-05-22 21:46:13 +02:00
Andreas Kling
1ec4db04cd LibWeb: Add a simple window.location object with some getters :^) 2020-05-18 21:42:40 +02:00
AnotherTest
013cb76d77 LibGemini: Implement rendering text/gemini documents to HTML
This also sets Content-Type to whatever 'meta' contains on success, to
allow the browser to pick up what the document contains.
2020-05-17 16:35:42 +02:00
Sergey Bugaev
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00